From 2b258c58a2eabdd7063da5ef84e33c84a4f8da16 Mon Sep 17 00:00:00 2001 From: YuanRisheng Date: Tue, 1 Aug 2023 20:07:28 +0800 Subject: [PATCH] move clear (#55844) --- paddle/phi/core/dense_tensor.h | 5 +++++ paddle/phi/core/dense_tensor.inl | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/phi/core/dense_tensor.h b/paddle/phi/core/dense_tensor.h index 1a40df1f2b3..50bc9547f9c 100644 --- a/paddle/phi/core/dense_tensor.h +++ b/paddle/phi/core/dense_tensor.h @@ -190,6 +190,11 @@ class DenseTensor : public TensorBase, void set_storage_properties( std::unique_ptr&& storage_properties); + void clear() { + holder_.reset(); + meta_.offset = 0; + } + private: friend class DenseTensorUtils; friend class phi::distributed::DistTensor; diff --git a/paddle/phi/core/dense_tensor.inl b/paddle/phi/core/dense_tensor.inl index 025b3b0efba..2a3e3ab1d78 100644 --- a/paddle/phi/core/dense_tensor.inl +++ b/paddle/phi/core/dense_tensor.inl @@ -57,11 +57,6 @@ void check_memory_size() const; void set_layout(const DataLayout layout); -void clear() { - holder_.reset(); - meta_.offset = 0; -} - void ShareBufferWith(const DenseTensor& tensor, bool only_buffer=false); void ShareDataTypeWith(const DenseTensor& tensor) { -- GitLab