class_docstr: Test that using the QNode with Torch integrates with the PennyLane stack
class_docstr_tok: ["Test","that","using","the","QNode","with","Torch","integrates","with","the","PennyLane","stack"]
docstr: Test evaluation and Jacobian if there are no trainable parameters
docstr_tok: ["Test","evaluation","and","Jacobian","if","there","are","no","trainable","parameters"]
code: def test_no_trainable_parameters(
      self,
      interface,
      dev,
      diff_method,
      grad_on_execution,
      device_vjp,
  ):
      """Test evaluation and Jacobian if there are no trainable parameters"""
  
      @qnode(
          dev,
          diff_method=diff_method,
          grad_on_execution=grad_on_execution,
          interface=interface,
          device_vjp=device_vjp,
      )
      def circuit(a, b):
          qml.RY(a, wires=0)
          qml.RX(b, wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))
  
      a = 0.1
      b = torch.tensor(0.2, dtype=torch.float64, requires_grad=False)
  
      res = circuit(a, b)
  
      if diff_method == "finite-diff":
          assert circuit.qtape.trainable_params == []
  
      assert isinstance(res, tuple)
      assert len(res) == 2
  
      assert res[0].shape == ()
      assert isinstance(res[0], torch.Tensor)
  
      assert res[1].shape == ()
      assert isinstance(res[1], torch.Tensor)
  
      with pytest.raises(
          RuntimeError,
          match="element 0 of tensors does not require grad and does not have a grad_fn",
      ):
          res[0].backward()
  
      with pytest.raises(
          RuntimeError,
          match="element 0 of tensors does not require grad and does not have a grad_fn",
      ):
          res[1].backward()
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import qnode
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 9 for calling the TestQNode obj's underlying member method code with example usage: obj.test_no_trainable_parameters(interface, dev, diff_method, grad_on_execution, device_vjp) and returns: qml,  qml