repair api format problem in totype, totensor, slice

This commit is contained in:
ms_yan 2020-07-25 10:01:03 +08:00
parent 0a74c8a52d
commit 7888f78bb8
3 changed files with 6 additions and 6 deletions

View File

@ -217,7 +217,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`.

View File

@ -78,9 +78,9 @@ 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(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:
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.
3. :py:obj:`slice`: Slice the generated indices from the slice object. Similar to `start:stop:step`.

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