Skip to content

Commit

Permalink
[Sparse]Fix device check (dmlc#6409)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <ubuntu@ip-172-31-24-117.ap-northeast-1.compute.internal>
  • Loading branch information
2 people authored and DominikaJedynak committed Mar 12, 2024
1 parent c31b946 commit 80c1b58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dgl_sparse/src/sddmm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ void _SDDMMSanityCheck(
mat1.dtype() == mat2.dtype(),
"SDDMM: the two dense matrices should have the same dtype.");
TORCH_CHECK(
mat1.device() == mat2.device(),
"SDDMM: the two dense matrices should on the same device.");
mat1.device() == mat2.device() && sparse_mat->device() == mat2.device(),
"SDDMM: the two dense matrices and sparse matrix should on the same "
"device.");
}

torch::Tensor SDDMMAutoGrad::forward(
Expand Down

0 comments on commit 80c1b58

Please sign in to comment.