Skip to content

Commit

Permalink
Update contiguous check (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaopengff authored Sep 29, 2024
1 parent 37ad8cb commit d39ee31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ bool computeLengthsAndCheckAndGetFlat(

void checkSingleTensorHelper(const at::Tensor& tensor)
{
TORCH_CHECK(tensor.is_sparse() || tensor.is_contiguous(), "input dense tensor has to be contiguous");
TORCH_CHECK(tensor.is_sparse() || tensor.is_contiguous(tensor.suggest_memory_format()), "input dense tensor has to be contiguous");
TORCH_CHECK(!tensor.is_cuda(), "CUDA tensor detected and CCL doesn't support CUDA buffers");
TORCH_CHECK(tensor.numel() >= 0, "input tensor numel should be non-negative");
}
Expand Down

0 comments on commit d39ee31

Please sign in to comment.