From 56e03fb0fce6f1d44edbcaacf0995349647241b6 Mon Sep 17 00:00:00 2001 From: OccupyMars2025 <31559413+OccupyMars2025@users.noreply.github.com> Date: Mon, 10 Oct 2022 15:50:38 +0800 Subject: [PATCH] [typo] correct typo errors in python\paddle\vision\datasets\cifar.py (#46738) --- python/paddle/nn/functional/activation.py | 4 ++-- python/paddle/vision/datasets/cifar.py | 4 ++-- python/paddle/vision/transforms/transforms.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/paddle/nn/functional/activation.py b/python/paddle/nn/functional/activation.py index 9a32853542b..90a3748cd32 100644 --- a/python/paddle/nn/functional/activation.py +++ b/python/paddle/nn/functional/activation.py @@ -1058,9 +1058,9 @@ def softmax(x, axis=-1, dtype=None, name=None): Parameters: 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 - 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. 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. diff --git a/python/paddle/vision/datasets/cifar.py b/python/paddle/vision/datasets/cifar.py index 6e630308079..97b4aa85eaa 100644 --- a/python/paddle/vision/datasets/cifar.py +++ b/python/paddle/vision/datasets/cifar.py @@ -109,8 +109,8 @@ class Cifar10(Dataset): transform=None, download=True, backend=None): - assert mode.lower() in ['train', 'test', 'train', 'test'], \ - "mode should be 'train10', 'test10', 'train100' or 'test100', but got {}".format(mode) + assert mode.lower() in ['train', 'test'], \ + "mode.lower() should be 'train' or 'test', but got {}".format(mode) self.mode = mode.lower() if backend is None: diff --git a/python/paddle/vision/transforms/transforms.py b/python/paddle/vision/transforms/transforms.py index 0b22a1a0336..3edc48e4724 100644 --- a/python/paddle/vision/transforms/transforms.py +++ b/python/paddle/vision/transforms/transforms.py @@ -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). - 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). If you want to keep the shape of output tensor as (H x W x C), you can set data_format = ``HWC`` . -- GitLab