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

[Unify Tensors PR #5] framework::Tensor inherits from DenseTensor,test=allcases #38632

Merged

Conversation

jim19930609
Copy link
Contributor

@jim19930609 jim19930609 commented Dec 31, 2021

PR types

New features

PR changes

Others

Describe

Previous works on constructing new tensor library "pten" introduced another Tensor type namely "DenseTensor", which temporarily co-exists with framework::Tensor and LoDTensor. In this series of PRs, we attempt to replace legacy "framework::Tensor and LoDTensor" by the newly implemented "DenseTensor", so as to facilitate the progress of "pten" joining original framework.

In this PR, we moved nearly all the members and interfaces from framework::Tensor to pten::DenseTensor, and then asked framework::Tensor to inherit from pten::DenseTensor. Note that interfaces (Split, Chunk, Slice, ...) with "framework::Tensor" as return will remain on framework::Tensor for now.

After this patch, all the original access to framework::Tensor interfaces will be re-routed
to accessing the corresponding interfaces on pten::DenseTensor, whereas framework::Tensor will become a simple wrapper that almost holds nothing.

image

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@jim19930609 jim19930609 force-pushed the tensor_inherit_from_dense_tensor branch from 513b868 to 7c6b10f Compare January 5, 2022 10:24
@jim19930609 jim19930609 force-pushed the tensor_inherit_from_dense_tensor branch from 648a699 to c8737e8 Compare January 6, 2022 03:55
@jim19930609 jim19930609 force-pushed the tensor_inherit_from_dense_tensor branch from c8737e8 to d35f7d1 Compare January 6, 2022 06:04
@jim19930609 jim19930609 force-pushed the tensor_inherit_from_dense_tensor branch from d35f7d1 to 1d38ca0 Compare January 6, 2022 07:53
@jim19930609 jim19930609 force-pushed the tensor_inherit_from_dense_tensor branch from 6fa06a6 to 2d91053 Compare January 7, 2022 02:35
Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

LGTM

@raindrops2sea
Copy link
Collaborator

raindrops2sea commented Jan 9, 2022

Describe

Please describe the reason behind the change more clearly.

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@jim19930609 jim19930609 merged commit 5c73a6e into PaddlePaddle:develop Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants