Skip to content

Commit 370f26d

Browse files
committed
And fix this one
1 parent e84af1b commit 370f26d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

test/test_sparse.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3372,12 +3372,14 @@ def test_is_nonzero(self, device):
33723372
torch.sparse_coo_tensor(([0, 1],), torch.empty(2, 0), (4, 0), device=device).is_nonzero()
33733373
self.assertTrue(torch.sparse_coo_tensor(([0],), 2.3 - 4.5j, (1,), dtype=torch.cfloat, device=device)
33743374
.is_nonzero())
3375-
self.assertTrue(torch.sparse_coo_tensor(([0],), 2.3 - 4.5j, (1,), dtype=torch.cdouble, device=device)
3376-
.is_nonzero())
3375+
if device != 'mps:0':
3376+
self.assertTrue(torch.sparse_coo_tensor(([0],), 2.3 - 4.5j, (1,), dtype=torch.cdouble, device=device)
3377+
.is_nonzero())
33773378
self.assertFalse(torch.sparse_coo_tensor(([0],), 0. + 0j, (1,), dtype=torch.cfloat, device=device)
33783379
.is_nonzero())
3379-
self.assertFalse(torch.sparse_coo_tensor(([0],), 0. + 0j, (1,), dtype=torch.cdouble, device=device)
3380-
.is_nonzero())
3380+
if device != 'mps:0':
3381+
self.assertFalse(torch.sparse_coo_tensor(([0],), 0. + 0j, (1,), dtype=torch.cdouble, device=device)
3382+
.is_nonzero())
33813383

33823384
@dtypes(torch.double, torch.cdouble)
33833385
@dtypesIfMPS(torch.float32, torch.complex64)

0 commit comments

Comments
 (0)