Skip to content

Commit

Permalink
DLPack: fix test using PyTorch API. (#8348)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysiraichi authored Dec 5, 2024
1 parent a1a1145 commit 4c99d21
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 @@ -2993,8 +2993,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 4c99d21

Please sign in to comment.