-
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
【inplace api】Batch add inplace api gt_, ge_, lt_, le_, eq_, not_equal_, logical_and_, logical_or_, logical_xor_, logical_not_, divide_, floor_divide_, bitwise_and_ , bitwise_or_, bitwise_xor_, bitwise_not_ #55509
【inplace api】Batch add inplace api gt_, ge_, lt_, le_, eq_, not_equal_, logical_and_, logical_or_, logical_xor_, logical_not_, divide_, floor_divide_, bitwise_and_ , bitwise_or_, bitwise_xor_, bitwise_not_ #55509
Conversation
… batch_add_inplace_api_2
你的PR提交成功,感谢你对开源项目的贡献! |
Sorry to inform you that fc4e297's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
28d8829
to
066b96f
Compare
This reverts commit c822064.
paddle/phi/core/meta_tensor.h
Outdated
@@ -86,6 +86,8 @@ class MetaTensor { | |||
// and it will be deleted in the future. | |||
virtual bool is_tensor_array() const; | |||
|
|||
virtual TensorBase* tensor() const; |
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.
MetaTensor用于Meta推导,需要隔离数据访问,以避免开发时加trick在静态推导功能中操作tensor data,这是之前fluid设计的问题,所以原先是有意不增加访问tensor的接口的,现在也不建议增加
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.
移回私有
paddle/phi/infermeta/binary.cc
Outdated
@@ -380,8 +380,9 @@ void CompareRawInferMeta(const MetaTensor& x, | |||
out->set_dims(make_ddim(out_dims_array)); | |||
out->share_lod(x); | |||
} | |||
|
|||
out->set_dtype(DataType::BOOL); | |||
if (out->tensor() == nullptr || out->tensor() != x.tensor()) { |
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.
- tensor是否为空原先就有方法可以判断
virtual bool operator!() const { return tensor_ == nullptr; }
- 需要判断是否是同一个tensor的话,可以增加is_same_tensor之类的接口,不建议直接暴露tensor指针
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.
增加is_same_tensor进行判断
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
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 for docs
文档cI又出bug了,之后如有问题我再单独@你修改~
…_, logical_and_, logical_or_, logical_xor_, logical_not_, divide_, floor_divide_, bitwise_and_ , bitwise_or_, bitwise_xor_, bitwise_not_ (PaddlePaddle#55509) * tmp commit * add atan2 * add inplace api * fix error * add inpalce divide * add inplace api * add more inplace * add more inpalce * fix logical_not error * support sinh and cosh in cpu * support asin, acos, atan, asinh, acosh, atanh in cpu * fix typro * fix typro * mv out atan2 ldexp * mv out atan2 ldexp * support sinh and cosh in gpu * support asin, acos, atan, asinh, acosh, atanh in gpu * fix ge error * fix dygraph commpare error * fix dygraph commpare error * check complex in python * fix cast inpalce error * open inplace test * fix ops.yaml error * mv cast inpalce to python * fix coverage ci * add last inplace * fix inplace error * fix cast error * fix error * add nan_to_num_ * fix typro * fix sparse cast error * remove gpu 4 * fix static cast error * tmp commit * add atan2 * add inplace api * fix error * add inpalce divide * add inplace api * add more inplace * add more inpalce * fix logical_not error * fix typro * fix typro * mv out atan2 ldexp * mv out atan2 ldexp * fix ge error * fix dygraph commpare error * fix dygraph commpare error * fix cast inpalce error * open inplace test * fix ops.yaml error * mv cast inpalce to python * fix coverage ci * add last inplace * fix inplace error * fix cast error * fix error * add nan_to_num_ * fix typro * fix sparse cast error * remove gpu 4 * fix static cast error * fix cast error * fix * Revert "check complex in python" This reverts commit c822064. * add renorm , fix error * add coverage * fix cumsum inpalce version error * add cast inpalce impl * rm test.log * fix multiply_dyfunction and add multiply_backward test * add and use is_same_tensor * fix typro * fix sone error * fix typro --------- Co-authored-by: Scotty <jmhgchn@gmail.com> Co-authored-by: Scotty <527407973@qq.com>
PR types
Others
PR changes
APIs
Description
Pcard-72375
batch add inplace api as follow,and these api return tensor's dtype as same as input x
will add inplace api as follow too