class_docstr: Test GPU with cuda for Torch device.
class_docstr_tok: ["Test","GPU","with","cuda","for","Torch","device","."]
docstr: Checks device executes with cuda is input data is cuda
docstr_tok: ["Checks","device","executes","with","cuda","is","input","data","is","cuda"]
code: def test_device_to_cuda(self):
      """Checks device executes with cuda is input data is cuda"""
  
      dev = qml.device("default.qubit.torch", wires=1)
  
      x = torch.tensor(
          0.1, requires_grad=True, device=torch.device("cuda")
      )
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(x, wires=0)
          qml.expval(qml.PauliX(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      res = dev.execute(tape)
  
      assert res.is_cuda
      assert "cuda" in dev._torch_device
  
      res.backward()
      assert x.grad.is_cuda
  
file_path: pennylane/tests/gpu/test_gpu_torch.py
imports: import pytest
  import pennylane
label_desc: Use image node_id 1 for calling the TestTorchDevice obj's underlying member method code with example usage: obj.test_device_to_cuda() without return types