diff --git a/mindspore/dataset/text/utils.py b/mindspore/dataset/text/utils.py index 153ec48431..4a35b3b232 100644 --- a/mindspore/dataset/text/utils.py +++ b/mindspore/dataset/text/utils.py @@ -210,7 +210,7 @@ def to_str(array, encoding='utf8'): Args: array (numpy.ndarray): Array of type `bytes` representing strings. - encoding (string): Indicating the charset for decoding. + encoding (str): Indicating the charset for decoding. Returns: numpy.ndarray, numpy array of `str`. diff --git a/mindspore/dataset/transforms/c_transforms.py b/mindspore/dataset/transforms/c_transforms.py index b99e6a69d7..78da7d1ab2 100644 --- a/mindspore/dataset/transforms/c_transforms.py +++ b/mindspore/dataset/transforms/c_transforms.py @@ -78,11 +78,11 @@ class Slice(cde.SliceOp): (Currently only rank-1 tensors are supported). Args: - *slices(Variable length argument list, supported types are, int, list(int), slice, None or Ellipses): - Maximum `n` number of arguments to slice a tensor of rank `n`. - One object in slices can be one of: + slices(Union[int, list[int], slice, None, Ellipses]): Maximum `n` number of arguments to slice a tensor + of rank `n`, one object in slices can be one of: + 1. :py:obj:`int`: Slice this index only. Negative index is supported. - 2. :py:obj:`list(int)`: Slice these indices ion the list only. Negative indices are supported. + 2. :py:obj:`list[int]`: Slice these indices ion the list only. Negative indices are supported. 3. :py:obj:`slice`: Slice the generated indices from the slice object. Similar to `start:stop:step`. 4. :py:obj:`None`: Slice the whole dimension. Similar to `:` in python indexing. 5. :py:obj:`Ellipses`: Slice all dimensions between the two slices. Similar to `...` in python indexing. diff --git a/mindspore/dataset/transforms/vision/py_transforms.py b/mindspore/dataset/transforms/vision/py_transforms.py index 07630b96cc..7b994c3117 100644 --- a/mindspore/dataset/transforms/vision/py_transforms.py +++ b/mindspore/dataset/transforms/vision/py_transforms.py @@ -100,7 +100,7 @@ class ToTensor: The range of channel dimension remains the same. Args: - output_type (numpy datatype, optional): The datatype of the numpy output (default=np.float32). + output_type (numpy datatype, optional): The datatype of the numpy output (default=numpy.float32). Examples: >>> py_transforms.ComposeOp([py_transforms.Decode(), @@ -129,7 +129,7 @@ class ToType: Convert the input Numpy image array to desired numpy dtype. Args: - output_type (numpy datatype): The datatype of the numpy output. e.g. np.float32. + output_type (numpy datatype): The datatype of the numpy output, e.g. numpy.float32. Examples: >>> import numpy as np