Skip to content

Commit

Permalink
Fixed LoD issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jim19930609 committed Jan 7, 2022
1 parent dadf29d commit 2d91053
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions paddle/pten/core/dense_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ DenseTensor::DenseTensor() {
storage_ = make_intrusive<paddle::experimental::SharedStorage>(
paddle::platform::CPUPlace());
inplace_version_counter_ = std::make_shared<TensorInplaceVersion>(0);
meta_ = DenseTensorMeta();
meta_.dtype = paddle::experimental::DataType::FLOAT32;
meta_.offset = 0;
}
Expand All @@ -242,7 +241,6 @@ DenseTensor::DenseTensor(const paddle::framework::proto::VarType::Type& dtype) {
storage_ = make_intrusive<paddle::experimental::SharedStorage>(
paddle::platform::CPUPlace());
inplace_version_counter_ = std::make_shared<TensorInplaceVersion>(0);
meta_ = DenseTensorMeta();
meta_.dtype = TransToPtenDataType(dtype);
meta_.offset = 0;
}
Expand Down Expand Up @@ -464,7 +462,7 @@ LEGACY_DATA_MEMBER_FUNC_INSTANTIATION(::paddle::experimental::complex128)
/* From framework::LoDTensor */
/* ------------------------------ */

DenseTensor::DenseTensor(const LoD& lod) : DenseTensor() { meta_.lod = lod; }
DenseTensor::DenseTensor(const LoD& lod) { meta_.lod = lod; }

void DenseTensor::set_lod(const LoD& lod) { meta_.lod = lod; }

Expand Down
3 changes: 1 addition & 2 deletions paddle/pten/core/utils/intrusive_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class intrusive_ptr {
}

intrusive_ptr& operator=(intrusive_ptr&& rhs) {
px = rhs.px;
rhs.px = nullptr;
swap(rhs);
return *this;
}

Expand Down

0 comments on commit 2d91053

Please sign in to comment.