Skip to content
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

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

engineer1109
Copy link
Contributor

PR types

Function optimization

PR changes

OPs

Describe

继续#49885 后续的迁移
PHI算子解藕代码
将ReshapeToMatrix和GetValue 从fluild的tensor_utils
删除一些代码中自己的inline GetValue,统一使用相同的GetValue

paddle/fluid/framework/tensor_util.h

@paddle-bot
Copy link

paddle-bot bot commented Feb 1, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以把Fluid目录下的这个函数删掉,其他用到这个函数的地方使用phi::ReshapeToMatrix替代

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经修改,等待CI完成

@@ -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);
Copy link
Contributor

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吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经修改,等待CI完成

@engineer1109 engineer1109 force-pushed the getvalue branch 4 times, most recently from 73431c7 to bba732e Compare February 5, 2023 07:02
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
@YuanRisheng
Copy link
Contributor

@luotao1 麻烦豁免一下coverage

@luotao1 luotao1 merged commit d09962a into PaddlePaddle:develop Feb 6, 2023
@luotao1
Copy link
Contributor

luotao1 commented Feb 6, 2023

@luotao1 麻烦豁免一下coverage

Done,已豁免合入

@engineer1109
Copy link
Contributor Author

#47615 第二个 tensor_util.h

@luotao1
Copy link
Contributor

luotao1 commented Feb 6, 2023

image

@engineer1109 已更新

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants