materialize_internal {mlr3torch} | R Documentation |
Materialize a Lazy Tensor
Description
Convert a lazy_tensor
to a torch_tensor
.
Usage
materialize_internal(x, device = "cpu", cache = NULL, rbind)
Arguments
x |
( |
device |
( |
cache |
( |
rbind |
( |
Details
Materializing a lazy tensor consists of:
Loading the data from the internal dataset of the
DataDescriptor
.Processing these batches in the preprocessing
Graph
s.Returning the result of the
PipeOp
pointed to by theDataDescriptor
(pointer
).
When materializing multiple lazy_tensor
columns, caching can be useful because:
a) Output(s) from the dataset might be input to multiple graphs.
(in task_dataset this is shoudl rarely be the case because because we try to merge them).
b) Different lazy tensors might be outputs from the same graph.
For this reason it is possible to provide a cache environment. The hash key for a) is the hash of the indices and the dataset. The hash key for b) is the hash of the indices dataset and preprocessing graph.