You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let torch accessor and dataloader handle either xarray.DataArray or xarray.Dataset inputs (#85)
* Let torch accessor support xarray.Dataset objects
Convert xarray.Dataset to xarray.DataArray first, so that the `.data` method work to get the underlying array which can be converted to a torch.Tensor.
* Add parametrized tests for xarray.DataArray and xarray.Dataset
Need to squeeze the extra first dimension in order to preserve the same output shape for xarray.DataArray and xarray.Dataset.
* Set batch_size in torch DataLoader to None instead of 1 to fix extra dim
Resolve the strange extra dimension of 1, which is because torch.utils.data.DataLoader adds a batch dimension by default. Setting to `batch_size=None` means no extra batch dimension is prepended.
* Add DataArray/Dataset parametrized tests for torch accessor
0 commit comments