未验证 提交 56e03fb0 编写于 作者: O OccupyMars2025 提交者: GitHub

[typo] correct typo errors in python\paddle\vision\datasets\cifar.py (#46738)

上级 f3329caa
...@@ -1058,9 +1058,9 @@ def softmax(x, axis=-1, dtype=None, name=None): ...@@ -1058,9 +1058,9 @@ def softmax(x, axis=-1, dtype=None, name=None):
Parameters: Parameters:
x (Tensor): The input Tensor with data type float32, float64. x (Tensor): The input Tensor with data type float32, float64.
axis (int, optional): The axis along which to perform log_softmax axis (int, optional): The axis along which to perform softmax
calculations. It should be in range [-D, D), where D is the calculations. It should be in range [-D, D), where D is the
dimensions of ``x`` . If ``axis`` < 0, it works the same way as rank of ``x`` . If ``axis`` < 0, it works the same way as
:math:`axis + D` . Default is -1. :math:`axis + D` . Default is -1.
dtype (str, optional): The data type of the output tensor, can be float32, float64. dtype (str, optional): The data type of the output tensor, can be float32, float64.
name (str, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None. name (str, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None.
......
...@@ -109,8 +109,8 @@ class Cifar10(Dataset): ...@@ -109,8 +109,8 @@ class Cifar10(Dataset):
transform=None, transform=None,
download=True, download=True,
backend=None): backend=None):
assert mode.lower() in ['train', 'test', 'train', 'test'], \ assert mode.lower() in ['train', 'test'], \
"mode should be 'train10', 'test10', 'train100' or 'test100', but got {}".format(mode) "mode.lower() should be 'train' or 'test', but got {}".format(mode)
self.mode = mode.lower() self.mode = mode.lower()
if backend is None: if backend is None:
......
...@@ -300,7 +300,7 @@ class ToTensor(BaseTransform): ...@@ -300,7 +300,7 @@ class ToTensor(BaseTransform):
Converts a PIL.Image or numpy.ndarray (H x W x C) to a paddle.Tensor of shape (C x H x W). Converts a PIL.Image or numpy.ndarray (H x W x C) to a paddle.Tensor of shape (C x H x W).
If input is a grayscale image (H x W), it will be converted to a image of shape (H x W x 1). If input is a grayscale image (H x W), it will be converted to an image of shape (H x W x 1).
And the shape of output tensor will be (1 x H x W). And the shape of output tensor will be (1 x H x W).
If you want to keep the shape of output tensor as (H x W x C), you can set data_format = ``HWC`` . If you want to keep the shape of output tensor as (H x W x C), you can set data_format = ``HWC`` .
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册