class_docstr: Class to test the shape of the Grad/Jacobian/Hessian with different return types.
class_docstr_tok: ["Class","to","test","the","shape","of","the","Grad\/Jacobian\/Hessian","with","different","return","types","."]
docstr: For one measurement and multiple param as a single array params, the gradient is an array.
docstr_tok: ["For","one","measurement","and","multiple","param","as","a","single","array","params",",","the","gradient","is","an","array","."]
code: def test_grad_single_measurement_multiple_param_array(
      self, dev, diff_method, grad_on_execution, device_vjp, shots
  ):
      """For one measurement and multiple param as a single array params, the gradient is an array."""
      if shots is not None and diff_method in ("backprop", "adjoint"):
          pytest.skip(
              "Test does not support finite shots and adjoint/backprop"
          )
  
      @qnode(
          dev,
          interface="torch",
          diff_method=diff_method,
          device_vjp=device_vjp,
          grad_on_execution=grad_on_execution,
      )
      def circuit(a):
          qml.RY(a[0], wires=0)
          qml.RX(a[1], wires=0)
          return qml.expval(qml.PauliZ(0))
  
      a = torch.tensor([0.1, 0.2], requires_grad=True)
  
      res = circuit(a, shots=shots)
  
      # gradient
      res.backward()
      grad = a.grad
  
      assert isinstance(grad, torch.Tensor)
      assert grad.shape == (2,)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import qnode
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 3 for calling the TestReturn obj's underlying member method code with example usage: obj.test_grad_single_measurement_multiple_param_array(dev, diff_method, grad_on_execution, device_vjp, shots) and returns: qml