mindspore.dataset.transforms
This module is to support common data augmentations. Some operations are implemented in C++ to provide high performance. Other operations are implemented in Python including using NumPy.
Common imported modules in corresponding API examples are as follows:
import mindspore.dataset as ds
import mindspore.dataset.transforms as transforms
Note: Legacy c_transforms and py_transforms are deprecated but can still be imported as follows:
from mindspore.dataset.transforms import c_transforms
from mindspore.dataset.transforms import py_transforms
See Common Data Processing and Augmentation tutorial for more details.
Descriptions of common data processing terms are as follows:
TensorOperation, the base class of all data processing operations implemented in C++.
PyTensorOperation, the base class of all data processing operations implemented in Python.
Transforms
Compose a list of transforms into a single transform. |
|
Tensor operation that concatenates all columns into a single tensor, only 1D tenspr is supported. |
|
Duplicate the input tensor to output, only support transform one column each time. |
|
Tensor operation to fill all elements in the tensor with the specified value. |
|
Mask content of the input tensor with the given predicate. |
|
Tensor operation to apply one hot encoding. |
|
Pad input tensor according to pad_shape, input tensor needs to have same rank. |
|
Randomly perform a series of transforms with a given probability. |
|
Randomly select one transform from a list of transforms to perform operation. |
|
Perform a series of transforms to the input image in a random order. |
|
Slice operation to extract a tensor out using the given n slices. |
|
Tensor operation to cast to a given MindSpore data type or NumPy data type. |
|
Perform the unique operation on the input tensor, only support transform one column each time. |
Utilities
Relationship operator. |