code: def test_partial_evaluation_autograd(diff_method):
      """Test gradient of partial evaluation matches gradients of
      individual full evaluations using autograd"""
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev, diff_method=diff_method)
      def circuit(x, y):
          qml.RX(x, wires=0)
          qml.RY(y[..., 0], wires=0)
          qml.RY(y[..., 1], wires=1)
          return qml.expval(qml.PauliZ(wires=0) @ qml.PauliZ(wires=1))
  
      batch_size = 4
  
      # the partial argument to construct a new circuit with
      y = np.random.uniform(size=2)
  
      # the batched argument to the new partial circuit
      x = np.random.uniform(size=batch_size, requires_grad=True)
  
      batched_partial_circuit = qml.batch_partial(circuit, y=y)
  
      # we could also sum over the batch dimension and use the regular
      # gradient instead of the jacobian, but either works
      grad = np.diagonal(qml.jacobian(batched_partial_circuit)(x))
  
      # check the results against individually executed circuits
      indiv_grad = []
      for x_indiv in x:
          indiv_grad.append(qml.grad(circuit, argnum=0)(x_indiv, y))
  
      assert np.allclose(grad, indiv_grad)
  
imports: import re
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: test_partial_evaluation_autograd(diff_method) and returns: qml