class_docstr: Test GPU with cuda for Torch device.
class_docstr_tok: ["Test","GPU","with","cuda","for","Torch","device","."]
docstr: Test that a warning is raised if the Torch device specified on
  PennyLane device creation differs from the Torch device of gate
  parameters.
docstr_tok: ["Test","that","a","warning","is","raised","if","the","Torch","device","specified","on","PennyLane","device","creation","differs","from","the","Torch","device","of","gate","parameters","."]
code: def test_different_devices_creation_and_parameters_warn(
      self, init_device, par_device
  ):
      """Test that a warning is raised if the Torch device specified on
      PennyLane device creation differs from the Torch device of gate
      parameters.
      """
      dev = qml.device(
          "default.qubit.torch", wires=1, torch_device=init_device
      )
  
      p = torch.tensor(0.543, dtype=torch.float64, device=par_device)
  
      @qml.qnode(dev, interface="torch")
      def circuit(x):
          qml.RX(x, wires=0)
          return qml.expval(qml.PauliY(0))
  
      with pytest.warns(
          UserWarning,
          match=f"Torch device {init_device} specified upon PennyLane device creation does not match",
      ):
          circuit(p)
  
file_path: pennylane/tests/gpu/test_gpu_torch.py
imports: import pytest
  import pennylane
label_desc: Use image node_id 6 for calling the TestTorchDevice obj's underlying member method code with example usage: obj.test_different_devices_creation_and_parameters_warn(init_device, par_device) and returns: qml