Skip to content

Commit

Permalink
Merge pull request #31 from qingshui/paddlebox
Browse files Browse the repository at this point in the history
fix zero tensor bug
  • Loading branch information
qingshui authored Feb 16, 2022
2 parents 78f584c + 9b9307c commit 77c533b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions paddle/fluid/framework/data_feed.h
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,7 @@ class MiniBatchGpuPack {
template <typename T>
void copy_host2device(Tensor* buf, const T* val, size_t size) {
if (size == 0) {
buf->mutable_data<T>({static_cast<int64_t>(size), 1}, place_);
return;
}
T* data = buf->mutable_data<T>({static_cast<int64_t>(size), 1}, place_);
Expand Down

0 comments on commit 77c533b

Please sign in to comment.