未验证 提交 8759c78d 编写于 作者: W WangZhen 提交者: GitHub

Fix select input error when handle 0 dim Tensor (#44251)

上级 e379455a
...@@ -71,7 +71,7 @@ class AssignFunctor { ...@@ -71,7 +71,7 @@ class AssignFunctor {
private: private:
void copy_tensor(const framework::LoDTensor &lod_tensor, void copy_tensor(const framework::LoDTensor &lod_tensor,
framework::LoDTensor *out) const { framework::LoDTensor *out) const {
if (lod_tensor.numel() == 0) return; if (!lod_tensor.IsInitialized()) return;
auto &out_tensor = *out; auto &out_tensor = *out;
paddle::framework::TensorCopy(lod_tensor, lod_tensor.place(), &out_tensor); paddle::framework::TensorCopy(lod_tensor, lod_tensor.place(), &out_tensor);
out_tensor.set_lod(lod_tensor.lod()); out_tensor.set_lod(lod_tensor.lod());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册