-
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
[PHI]move ReshapeToMatrix & GetValue #50139
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
116ab37
to
6c52aa4
Compare
@@ -867,4 +867,60 @@ template void TensorToVector(const phi::DenseTensor& src, | |||
template void TensorToVector(const phi::DenseTensor& src, | |||
std::vector<phi::dtype::complex<double>>* dst); | |||
|
|||
phi::DenseTensor ReshapeToMatrix(const phi::DenseTensor& src, |
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.
可以把Fluid目录下的这个函数删掉,其他用到这个函数的地方使用phi::ReshapeToMatrix替代
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.
已经修改,等待CI完成
paddle/fluid/operators/isfinite_op.h
Outdated
@@ -129,17 +130,17 @@ inline void TensorIsfinite(const phi::DenseTensor& tensor, | |||
inline bool TensorContainsNAN(const phi::DenseTensor& tensor) { | |||
phi::DenseTensor out; | |||
TensorContainsNAN(tensor, &out); | |||
return GetValue<bool>(&out); | |||
return phi::GetValue<bool>(&out); |
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.
这里还是不建议进行修改,Phi下新增的GetValue和Fluid下的还是有点不一样,缺少异构设备(npu,mlu)的支持,建议还是用Fluid下原本的GetValue吧
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.
已经修改,等待CI完成
73431c7
to
bba732e
Compare
fix paddle::memory::copy to phi::Copy fix conflict template fix header remove unused fix Alloc fix Copy fix template fix template remove reshapematrix on fluid change isfinite phi move ReshapeToMatrix & GetValue fix paddle::memory::copy to phi::Copy fix conflict template fix header remove unused fix Alloc fix Copy fix template fix template remove reshapematrix on fluid change isfinite fix namespace fix header fix namespace
bba732e
to
ebcfb66
Compare
@luotao1 麻烦豁免一下coverage |
Done,已豁免合入 |
#47615 第二个 tensor_util.h |
@engineer1109 已更新 |
PR types
Function optimization
PR changes
OPs
Describe
继续#49885 后续的迁移
PHI算子解藕代码
将ReshapeToMatrix和GetValue 从fluild的tensor_utils
删除一些代码中自己的inline GetValue,统一使用相同的GetValue
paddle/fluid/framework/tensor_util.h