The code below results in an error when it’s run with a cuda tensor input. How do I resolve the error?
import torch

class TestTensor(torch.Tensor):
    def test(self):
          print('test')

x = torch.ones(1,3,4,4).cuda()

x_out = TestTensor(x)

Throws the following error:
Traceback (most recent call last):
  File "test_tensor.py", line 8, in <module>
    x_out = TestTensor(x)
TypeError: expected CPU (got CUDA)