Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ysiraichi committed Nov 1, 2024
1 parent 7c7ad4e commit ca03671
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2916,8 +2916,7 @@ def test_dlpack_xla_to_pytorch_cuda(self):
@onlyIfPJRTDeviceIsCUDA
def test_dlpack_xla_to_pytorch_cuda_protocol_conversion(self):
xla_t1 = torch.arange(5).to(xm.xla_device())
caps_t1 = torch.utils.dlpack.to_dlpack(xla_t1)
cuda_t1 = torch.utils.dlpack.from_dlpack(caps_t1)
cuda_t1 = torch.utils.dlpack.from_dlpack(xla_t1)
self.assertEqual(cuda_t1.device.type, 'cuda')
self.assertEqual(cuda_t1.device.index, xla_t1.device.index)
cuda_t1[0] = cuda_t1[0] + 20
Expand Down

0 comments on commit ca03671

Please sign in to comment.