The shape of the tensor, where the first dimension (batch) must be NA. When it is not specified, the lazy tensor input column needs to have a known shape. When it is set to "infer", the shape is inferred from an example batch.
Internals
The returned batchgetter materializes the lazy tensor column to a tensor.
Input and Output Channels
One input channel called "input" and one output channel called "output". For an explanation see PipeOpTorch.
State
The state is set to the input shape.
Examples
po_ingress = po("torch_ingress_ltnsr")task = tsk("lazy_iris")md = po_ingress$train(list(task))[[1L]]ingress = md$ingress
x_batch = ingress[[1L]]$batchgetter(data = task$data(1,"x"), cache =NULL)x_batch
# Now we try a lazy tensor with unknown shape, i.e. the shapes between the rows can differds = dataset( initialize =function() self$x = list(torch_randn(3,10,10), torch_randn(3,8,8)), .getitem =function(i) list(x = self$x[[i]]), .length =function()2)()task_unknown = as_task_regr(data.table( x = as_lazy_tensor(ds, dataset_shapes = list(x =NULL)), y = rnorm(2)), target ="y", id ="example2")# this task (as it is) can NOT be processed by PipeOpTorchIngressLazyTensor# It therefore needs to be preprocessedpo_resize = po("trafo_resize", size = c(6,6))task_unknown_resize = po_resize$train(list(task_unknown))[[1L]]# printing the transformed column still shows unknown shapes,# because the preprocessing pipeop cannot infer them,# however we know that the shape is now (3, 10, 10) for all rowstask_unknown_resize$data(1:2,"x")po_ingress$param_set$set_values(shape = c(NA,3,6,6))md2 = po_ingress$train(list(task_unknown_resize))[[1L]]ingress2 = md2$ingress
x_batch2 = ingress2[[1L]]$batchgetter( data = task_unknown_resize$data(1:2,"x"), cache =NULL)
x_batch2