to_pytorch()

Transforms a diffgram Directory object into a pytorch Dataset object.

Parameters:

  • transform (optional): A pytorch Transform object to be applied to each of the dataset items.
dataset = project.directory.get('my dataset')
pytorch_dataset = dataset.to_pytorch()

Did this page help you?