mindspore.dataset.transforms.c_transforms.Compose

class mindspore.dataset.transforms.c_transforms.Compose(transforms)[source]

Compose a list of transforms into a single transform.

Parameters

transforms (list) – List of transformations to be applied.

Raises
  • TypeError – If transforms is not of type list.

  • ValueError – If transforms is empty.

  • TypeError – If elements of transforms are neither Python callable objects nor data processing operations in c_transforms.

Supported Platforms:

CPU

Examples

>>> compose = c_transforms.Compose([c_vision.Decode(), c_vision.RandomCrop(512)])
>>> image_folder_dataset = image_folder_dataset.map(operations=compose)