-
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
Remove the declaration of using Tensor in framework/tensor.h #46432
Remove the declaration of using Tensor in framework/tensor.h #46432
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
… remove_needless_using_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 for CI-OP-Benchmark
PR types
Function optimization
PR changes
Others
Describe
Remove the declaration of using Tensor in framework/tensor.h
本RP完成年初基础框架Tensor统一的部分遗留工作,事实上现在框架中的基础Tensor即为phi::DenseTensor,原framework::Tensor和framework::LoDTensor都是采用using的方式作为phi::DenseTensor的别名
当初认为改动成本较高,因此搁置了,但是继续保留这样的状态,会有以下危害:
目前框架内
Tensor
主要指对外暴露的paddle::experimental::Tensor
,这是paddle对外C++ API的基础数据结构,内部即为DenseTensor
,但experimental后续是需要去掉的,而由于paddle::framework::Tensor
通过using的关系仍然保留着,这样如果去掉experimental的话,paddle::Tensor
和paddle::framework::Tensor
在编译时就有冲突的风险,影响框架正确性和开发效率因此,我们还是需要尽早将历史残留的using去掉,以确保后续框架的稳定发展
TODO:
using Tensor = phi::DenseTensor
这样的声明,后续仍然需要继续去除,本PR改动过多,不严格保证均删除这样的声明using LoDTensor = phi::DenseTensor
的声明paddle::experimental::Tensor
的experimental