Skip to content

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