diff --git a/paddle/phi/api/include/tensor_utils.h b/paddle/phi/api/include/tensor_utils.h index 43a19a09c1448283b3552f41e4f9ccec7fccbf48..3fcd8b2a8de6616a60283e700bb2194ad2ccd5fd 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 c083e5be5f1d8f9d86fb6e7fb9d436e775692986..b8d25e4f22b100aefa28f498101b5f50e518fefe 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 ||