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

transform complex scale to tensor #33699

Merged

Conversation

MingMingShangTian
Copy link
Contributor

PR types

New features

PR changes

APIs

Describe

Fix the error in binary when computing between complex number and tensor.

The bug is as follow.
image

@paddle-bot-old
Copy link

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

other_var = create_tensor(
other_var, dtype=lhs_dtype, shape=self.shape)
if isinstance(other_var, complex):
global paddle
Copy link
Contributor

Choose a reason for hiding this comment

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

global paddle? 为什么这么用

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不加global paddle的话,会报 "NameError: free variable 'paddle' referenced before assignment in enclosing scope" 的错误。
如果from ...tensor.creation import to_tensor 这样引用的话,则会报
ImportError: cannot import name '_unpack_saved_dict' from 'paddle.fluid.io' 错误。

@MingMingShangTian MingMingShangTian merged commit 5db0c84 into PaddlePaddle:develop Jun 22, 2021
@MingMingShangTian MingMingShangTian deleted the complex_scale branch June 22, 2021 07:56
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