-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
change '/' method from scale Op to elementwise_div Op #33279
change '/' method from scale Op to elementwise_div Op #33279
Conversation
… equal the result of elementwise_div method
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to add a unittest for this case?
('__truediv__', _binary_creator_('__truediv__', 'elementwise_div', | ||
False, _scalar_div_)), | ||
('__rdiv__', _binary_creator_('__rdiv__', 'elementwise_div', True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__rdiv__ 在python3也没有了吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,没有了。 参考python3 的文档 https://docs.python.org/3/reference/datamodel.html
@@ -187,6 +187,13 @@ def test_tensor_div_scalar(self): | |||
c = paddle.full([2, 2, 2], 0.5, dtype="float32") | |||
self.check_operation(a, b, c, '/') | |||
|
|||
# tensor(float32) / scalar(int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在静态图的那个单测里面也加一下?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…3279) * fix the bug of div operation result using scale method do not exactly equal the result of elementwise_div method * remove __div__ , __rdiv__ methods which do not define in python3 * modify the note * add test case * add test case
…Paddle#33279)" This reverts commit ae93d9c.
…Paddle#33279)" (PaddlePaddle#35650) This reverts commit ae93d9c.
PR types
Bug fixes
PR changes
APIs
Describe
_scalar_div_
function.The bug is as follow.
And after fixing the bug
__div__
,__rdiv__
methods which do not be defined in python3 standard.