code: def test_template_integration():
      """Test that a PassthruQNode default.mixed.torch works with templates."""
      dev = qml.device("default.mixed", wires=2)
  
      @qml.qnode(dev, interface="torch", diff_method="backprop")
      def circuit(weights):
          qml.templates.StronglyEntanglingLayers(weights, wires=[0, 1])
          return qml.expval(qml.PauliZ(0))
  
      shape = qml.templates.StronglyEntanglingLayers.shape(
          n_layers=2, n_wires=2
      )
      weights = torch.tensor(
          np.random.random(shape),
          dtype=torch.float64,
          requires_grad=True,
      )
  
      res = circuit(weights)
      res.backward()
  
      assert isinstance(weights.grad, torch.Tensor)
      assert weights.grad.shape == weights.shape
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_mixed import DefaultMixed
label_desc: Use image node_id 1 for calling a global function with example usage: test_template_integration() and returns: qml