Browse Source

!3566 dataset: api format problem in totype, totensor, slice

Merge pull request !3566 from ms_yan/r0.6_api_format
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
d9ca3f2e88
3 changed files with 7 additions and 7 deletions
  1. +1
    -1
      mindspore/dataset/text/utils.py
  2. +4
    -4
      mindspore/dataset/transforms/c_transforms.py
  3. +2
    -2
      mindspore/dataset/transforms/vision/py_transforms.py

+ 1
- 1
mindspore/dataset/text/utils.py View File

@@ -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`.


+ 4
- 4
mindspore/dataset/transforms/c_transforms.py View File

@@ -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.


+ 2
- 2
mindspore/dataset/transforms/vision/py_transforms.py View File

@@ -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


Loading…
Cancel
Save