Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions aten/src/ATen/native/sparse/cuda/SparseCUDATensor.cu
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ SparseTensor coalesce_sparse_cuda(const SparseTensor& self) {
}
}
////////////////////////////////////////////////////////////

SparseTensor dst = ::at::native::sparse_coo_tensor(newIndices, newValues, self.sizes())._coalesced_(true);
// We can use unsafe sparse tensor constructor because the indices do not
// need to be revalidated as we do not add or change indices, just remove
// duplicates.
SparseTensor dst = ::at::native::_sparse_coo_tensor_unsafe(newIndices, newValues, self.sizes())._coalesced_(true);

THCudaCheck(cudaGetLastError());
return dst;
Expand Down