composer.utils.add_vision_dataset_transform(dataset, transform, is_tensor_transform=False)[source]#

Add a transform to a datasetโ€™s collection of transforms.

  • dataset (VisionDataset) โ€“ A torchvision dataset.

  • transform (Callable) โ€“ Function to be added to the datasetโ€™s collection of transforms.

  • is_tensor_transform (bool) โ€“ Whether transform acts on data of the type Tensor. The transform will be inserted before or after ToTensor depending on if this is True or False respectively. If ToTensor is not present, the transform will be appended to the end of the collection of transforms. (default: False)


None โ€“ The dataset is modified in-place.