Akash Agnihotri
10/23/2023, 10:42 AMAbstractDataSet
to save and load torch object.
When we use this dataset as part of a kedro pipeline, the node does not create local folder when saving the data ?
Question is, do we need to implement this functionality ourself in our custom dataset, or is it somehting provided by kedor
or ``AbstractDataSet` ?Deepyaman Datta
10/23/2023, 11:05 AMAkash Agnihotri
10/23/2023, 5:29 PMdef _save(self, data: pl.LightningDataModule) -> None:
"""Save data module to filepath."""
with open(self.filepath, "wb+") as file:
torch.save(data, file)
Deepyaman Datta
10/23/2023, 6:12 PMfsspec
. As mentioned, directories aren't created magically by AbstractDataset
, but IIRC fsspec
implementations will handle the create (which is part of why we use it). Also, it will enable use on other filesystems, like if you want to save to s3.