Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/paddle/nn/functional/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,9 +1056,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.
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/vision/datasets/cifar.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def __init__(self,
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:
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`` .
Expand Down