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

fix Tensor.numpy()[0] to float(Tensor) to adapt 0D #2884

Merged
merged 1 commit into from Feb 7, 2023

Conversation

zhwesky2010
Copy link
Contributor

@zhwesky2010 zhwesky2010 commented Feb 6, 2023

PR types

other

PR changes

other

Describe

有些Tensor正确的语义为0D Tensor,其shape为[],当前使用了shape为[1]替代,也就是向量Tensor:

在升级为0D后,Tensor.numpy()[0] 的写法不再使用,将其改变为 float(Tensor) 的写法,兼容升级前后。

@mergify mergify bot added the Example label Feb 6, 2023
@yt605155624 yt605155624 added this to the r1.4.0 milestone Feb 6, 2023
@yt605155624 yt605155624 merged commit 16d8436 into PaddlePaddle:develop Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants