Skip to content

Commit

Permalink
[Refactoring Tensor PR #7] differentiate deprecated interfaces (#39228)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shixiaowei02 committed Jan 26, 2022
1 parent 01d04be commit 3047085
Show file tree
Hide file tree
Showing 7 changed files with 600 additions and 642 deletions.
6 changes: 3 additions & 3 deletions paddle/fluid/framework/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Variable {
private:
// This method hides type T, so it doesn't appear as a template parameter of
// Variable.
pten::TensorInplaceVersion* InplaceVersionCounter();
pten::DenseTensor::InplaceVersion* InplaceVersionCounter();

public:
void SetInplaceVersionToZero();
Expand Down Expand Up @@ -114,8 +114,8 @@ class Variable {
std::shared_ptr<Placeholder> holder_;
};

inline pten::TensorInplaceVersion* Variable::InplaceVersionCounter() {
pten::TensorInplaceVersion* version_counter_ptr(nullptr);
inline pten::DenseTensor::InplaceVersion* Variable::InplaceVersionCounter() {
pten::DenseTensor::InplaceVersion* version_counter_ptr(nullptr);
if (IsType<framework::LoDTensor>()) {
version_counter_ptr =
&GetMutable<framework::LoDTensor>()->InplaceVersionCounter();
Expand Down
2 changes: 1 addition & 1 deletion paddle/pten/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cc_library(kernel_context SRCS kernel_context.cc DEPS pten_enforce pten_context)
cc_library(tensor_base SRCS tensor_base.cc allocator.cc storage.cc DEPS pten_enforce)
cc_library(tensor_meta SRCS tensor_meta.cc DEPS pten_enforce mixed_vector)
cc_library(lod_utils SRCS lod_utils.cc DEPS pten_enforce mixed_vector)
cc_library(dense_tensor SRCS dense_tensor.cc DEPS convert_utils tensor_meta tensor_base)
cc_library(dense_tensor SRCS dense_tensor.cc dense_tensor_impl.cc DEPS convert_utils tensor_meta tensor_base)
cc_library(pten_device_context SRCS device_context.cc DEPS tensor_base )

cc_library(meta_tensor SRCS meta_tensor.cc DEPS tensor_base tensor_meta dense_tensor)
Expand Down
Loading

0 comments on commit 3047085

Please sign in to comment.