[Cpp API Compatibility] add all & allclose API#77542
[Cpp API Compatibility] add all & allclose API#77542Le-soleile wants to merge 19 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
/re-run all-failed |
|
/re-run all-failed |
|
/re-run all-failed |
1 similar comment
|
/re-run all-failed |
| // Read the value from the tensor (could be bool, int8, int32, etc.) | ||
| auto dtype = result_tensor->dtype(); | ||
| if (dtype == phi::DataType::BOOL) { | ||
| bool* bool_ptr = result_tensor->data<bool>(); |
There was a problem hiding this comment.
确认一下paddle::experimental::allclose返回结果的tensor是什么,如果是逐个元素的比较结果,这里的处理就不对,本地做一下实验,将tensor打印出来看一下(type和data),保存好实验结果
|
/re-run all-failed |
2 similar comments
|
/re-run all-failed |
|
/re-run all-failed |
|
/re-run all-failed |
3 similar comments
|
/re-run all-failed |
|
/re-run all-failed |
|
/re-run all-failed |
|
/re-run xpu test |
|
/re-run all-failed |
1 similar comment
|
/re-run all-failed |
|
/re-run all-failed |
| } else { | ||
| PD_THROW("allclose: unsupported result dtype"); | ||
| } | ||
| } |
There was a problem hiding this comment.
all 和 allclose 的实现是否可以放在 all.h 和 allclose.h?同时暴露 at::all 和 at::allclose?
There was a problem hiding this comment.
添加后需要像 https://github.com/PaddlePaddle/Paddle/pull/78037/changes#diff-5847905442941e26d93374313b0e119d01f39267c25427c467c7829150972c06 在 paddle/phi/api/include/compat/ATen/Functions.h 将相关函数 include 过来,以便用户使用
| at::Tensor absolute() const { return abs(); } | ||
|
|
||
| at::Tensor& absolute_() const { return abs_(); } | ||
|
|
|
/re-run all-failed |



PR Category
Execute Infrastructure
PR Types
New features
Description
新增 all & allclose 兼容接口
是否引起精度变化
否