xbatcher.loaders.torch.MapDataset#

class xbatcher.loaders.torch.MapDataset(*args: Any, **kwargs: Any)[source]#
__init__(X_generator: ~xbatcher.generators.BatchGenerator, y_generator: ~typing.Optional[~xbatcher.generators.BatchGenerator] = None, transform: ~collections.abc.Callable[[xarray.core.dataarray.DataArray | xarray.core.dataset.Dataset], torch.Tensor] = <function to_tensor>, target_transform: ~collections.abc.Callable[[xarray.core.dataarray.DataArray | xarray.core.dataset.Dataset], torch.Tensor] = <function to_tensor>) None[source]#

PyTorch Dataset adapter for Xbatcher

Parameters:
X_generatorxbatcher.BatchGenerator
y_generatorxbatcher.BatchGenerator
transform, target_transformcallable, optional

A function/transform that takes in an Xarray object and returns a transformed version in the form of a torch.Tensor.

Methods

__init__(X_generator[, y_generator, ...])

PyTorch Dataset adapter for Xbatcher