Create a lazy tensor.
Arguments
- data_descriptor
(
DataDescriptor
orNULL
)
The data descriptor orNULL
for a lazy tensor of length 0.- ids
(
integer()
)
The elements of thedata_descriptor
to 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)