未验证 提交 7f506669 编写于 作者: H Huang Jiyi 提交者: GitHub

update (#51773)

上级 604b7a53
...@@ -33,12 +33,11 @@ using Deleter = std::function<void(void*)>; ...@@ -33,12 +33,11 @@ using Deleter = std::function<void(void*)>;
* @param dtype The data type of the tensor, should correspond to data type of * @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` * `data`. See PD_FOR_EACH_DATA_TYPE in `phi/common/data_type.h`
* @param layout The data layout of the tensor. * @param layout The data layout of the tensor.
* @param place The place where the tensor is located, should correspond to * @param place The place where the tensor is located.
* place of `data`. * If `place` is default value, it will be inferred from `data`,
* If `place` use the default value, it will be inferred from * However,the feature is only supported on CPU or GPU.
* `data`, However,the feature is only supported on CPU or GPU. * If `place` is not default value, make sure that `place` is equal
* So make sure that `place` is equal to the place of `data` when * to the place of `data`
* using other devices.
* @param deleter A function or function object that will be called to free the * @param deleter A function or function object that will be called to free the
* memory buffer. * memory buffer.
* *
......
...@@ -14,8 +14,6 @@ limitations under the License. */ ...@@ -14,8 +14,6 @@ limitations under the License. */
#include "paddle/phi/api/include/tensor_utils.h" #include "paddle/phi/api/include/tensor_utils.h"
#include <set>
#include "paddle/phi/api/lib/api_registry.h" #include "paddle/phi/api/lib/api_registry.h"
#include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/core/dense_tensor.h"
...@@ -72,8 +70,6 @@ PADDLE_API Tensor from_blob(void* data, ...@@ -72,8 +70,6 @@ PADDLE_API Tensor from_blob(void* data,
phi::errors::InvalidArgument( phi::errors::InvalidArgument(
"shape cannot be constructed from a Tensor.")); "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; phi::Place data_place;
if (place.GetType() == phi::AllocationType::UNDEFINED || if (place.GetType() == phi::AllocationType::UNDEFINED ||
place.GetType() == phi::AllocationType::CPU || place.GetType() == phi::AllocationType::CPU ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册