Creates a lazy_tensor vector.
Because it is a vector, it can be stored in a data.table, which gives mlr3torch the ability
to use arbitrary tensors in its task.
It is 'lazy', because the tensors are not stored in-memory, but only loaded when calling
materialize().
The vector itself only describes how to load the data.
It is also possible to preprocess lazy_tensors, e.g. via po("augment_<key>"),
and po("trafo_<key>").
Arguments
- data_descriptor
(
DataDescriptororNULL)
The data descriptor orNULLfor a lazy tensor of length 0.- ids
(
integer())
The elements of thedata_descriptorto be included in the lazy tensor.
Examples
ds = dataset("example",
initialize = function() self$iris = iris[, -5],
.getitem = function(i) list(x = torch_tensor(as.numeric(self$iris[i, ]))),
.length = function() nrow(self$iris)
)()
dd = as_data_descriptor(ds, list(x = c(NA, 4L)))
lt = as_lazy_tensor(dd)