class_docstr: Test that the user-defined dtype of the device is preserved for QNode
  evaluation
class_docstr_tok: ["Test","that","the","user-defined","dtype","of","the","device","is","preserved","for","QNode","evaluation"]
docstr: Test that the user-defined dtype of the device is preserved
  for QNodes with complex-valued outputs
docstr_tok: ["Test","that","the","user-defined","dtype","of","the","device","is","preserved","for","QNodes","with","complex-valued","outputs"]
code: def test_complex_dtype(self, c_dtype, c_dtype_torch, measurement):
      """Test that the user-defined dtype of the device is preserved
      for QNodes with complex-valued outputs"""
      if c_dtype_torch == "torchc64":
          c_dtype_torch = torch.complex64
      else:
          c_dtype_torch = torch.complex128
  
      p = torch.tensor(0.543)
  
      dev = qml.device("default.mixed", wires=3, c_dtype=c_dtype)
  
      @qml.qnode(dev, interface="torch", diff_method="backprop")
      def circuit(x):
          qml.RX(x, wires=0)
          return qml.apply(measurement)
  
      res = circuit(p)
      assert res.dtype == c_dtype_torch
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_mixed import DefaultMixed
label_desc: Use image node_id 2 for calling the TestDtypePreserved obj's underlying member method code with example usage: obj.test_complex_dtype(c_dtype, c_dtype_torch, measurement) and returns: qml