Skip to content

Commit

Permalink
call resize directly in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
JiabinYang committed Mar 24, 2021
1 parent 1384322 commit 36e4b49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddle/fluid/extension/src/ext_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ Tensor::Tensor(const PlaceType &place, const std::vector<int64_t> &shape)
: tensor_(std::make_shared<framework::LoDTensor>()),
place_(place),
stream_(StreamWrapper()) {
reshape(shape);
GET_CASTED_TENSOR
tensor->Resize(framework::make_ddim(shape));
}

template <typename T>
Expand Down

1 comment on commit 36e4b49

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.