Skip to content

Commit

Permalink
result tensor options should come from input.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Jul 6, 2024
1 parent 9190573 commit e5e1316
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions graphbolt/src/cnumpy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ torch::Tensor OnDiskNpyArray::IndexSelectIOUring(torch::Tensor index) {
shape.push_back(num_index);
shape.insert(shape.end(), feature_dim_.begin() + 1, feature_dim_.end());
auto result = torch::empty(
shape, torch::TensorOptions()
shape, index.options()
.dtype(dtype_)
.layout(torch::kStrided)
.device(torch::kCPU)
.requires_grad(false));
auto result_buffer = reinterpret_cast<char *>(result.data_ptr());

Expand Down

0 comments on commit e5e1316

Please sign in to comment.