From 7f506669a778f701db993f3aaee9f2b641a893e3 Mon Sep 17 00:00:00 2001 From: Huang Jiyi <43315610+huangjiyi@users.noreply.github.com> Date: Mon, 20 Mar 2023 10:53:51 +0800 Subject: [PATCH] update (#51773) --- paddle/phi/api/include/tensor_utils.h | 11 +++++------ paddle/phi/api/lib/tensor_utils.cc | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/paddle/phi/api/include/tensor_utils.h b/paddle/phi/api/include/tensor_utils.h index 43a19a09c14..3fcd8b2a8de 100644 --- a/paddle/phi/api/include/tensor_utils.h +++ b/paddle/phi/api/include/tensor_utils.h @@ -33,12 +33,11 @@ using Deleter = std::function; * @param dtype The data type of the tensor, should correspond to data type of * `data`. See PD_FOR_EACH_DATA_TYPE in `phi/common/data_type.h` * @param layout The data layout of the tensor. - * @param place The place where the tensor is located, should correspond to - * place of `data`. - * If `place` use the default value, it will be inferred from - * `data`, However,the feature is only supported on CPU or GPU. - * So make sure that `place` is equal to the place of `data` when - * using other devices. + * @param place The place where the tensor is located. + * If `place` is default value, it will be inferred from `data`, + * However,the feature is only supported on CPU or GPU. + * If `place` is not default value, make sure that `place` is equal + * to the place of `data` * @param deleter A function or function object that will be called to free the * memory buffer. * diff --git a/paddle/phi/api/lib/tensor_utils.cc b/paddle/phi/api/lib/tensor_utils.cc index c083e5be5f1..b8d25e4f22b 100644 --- a/paddle/phi/api/lib/tensor_utils.cc +++ b/paddle/phi/api/lib/tensor_utils.cc @@ -14,8 +14,6 @@ limitations under the License. */ #include "paddle/phi/api/include/tensor_utils.h" -#include - #include "paddle/phi/api/lib/api_registry.h" #include "paddle/phi/core/dense_tensor.h" @@ -72,8 +70,6 @@ PADDLE_API Tensor from_blob(void* data, phi::errors::InvalidArgument( "shape cannot be constructed from a Tensor.")); - // TODO(huangjiyi): We need copy data to specified place when - // the input place is different with place of data. phi::Place data_place; if (place.GetType() == phi::AllocationType::UNDEFINED || place.GetType() == phi::AllocationType::CPU || -- GitLab