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

Fixed corner case in all shape function #38284

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

DesmonDay
Copy link
Contributor

@DesmonDay DesmonDay commented Dec 20, 2021

PR types

Bug fixes

PR changes

APIs

Describe

Fix the corner case when the function has argument shape constructed by list with Tensor and int like the following case.

import paddle
import numpy as np
size_a = paddle.to_tensor(np.array(1))
paddle.zeros(shape=[size_a, 100], dtype="float32")

It runs well in PyTorch

import torch
import numpy as np
size_a = torch.from_numpy(np.array(1))
torch.zeros(shape=[size_a, 100], dtype="float32")

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZHUI ZHUI merged commit 4e4d58b into PaddlePaddle:develop Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants