dataset_shapes: (named list() of (integer() or NULL))
The shapes of the output. Names are the elements of the list returned by the dataset. If the shape is not NULL (unknown, e.g. for images of different sizes) the first dimension must be NA to indicate the batch dimension.
...: (any)
Further arguments passed to the DataDescriptor constructor.
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))()as_data_descriptor(ds, list(x = c(NA,4L)))# if the dataset has a .getbatch method, the shapes are inferredds2 = dataset("example", initialize =function() self$iris = iris[,-5], .getbatch =function(i) list(x = torch_tensor(as.matrix(self$iris[i,]))), .length =function() nrow(self$iris))()as_data_descriptor(ds2)