class_docstr: Test that the QNode correctly changes shot value, and
  differentiates it.
class_docstr_tok: ["Test","that","the","QNode","correctly","changes","shot","value",",","and","differentiates","it","."]
docstr: Test that temporarily setting the shots works
  for gradient computations
docstr_tok: ["Test","that","temporarily","setting","the","shots","works","for","gradient","computations"]
code: def test_gradient_integration(self):
      """Test that temporarily setting the shots works
      for gradient computations"""
      dev = DefaultQubit()
      a, b = torch.tensor([0.543, -0.654], requires_grad=True)
  
      @qnode(
          dev, interface="torch", diff_method=qml.gradients.param_shift
      )
      def cost_fn(a, b):
          qml.RY(a, wires=0)
          qml.RX(b, wires=1)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliY(1))
  
      res = jacobian(
          lambda a, b: cost_fn(a, b, shots=[10000, 10000, 10000]),
          (a, b),
      )
      res = qml.math.transpose(torch.stack(res))
      assert dev.shots is None
      assert len(res) == 3
  
      expected = torch.tensor(
          [torch.sin(a) * torch.sin(b), -torch.cos(a) * torch.cos(b)]
      )
      assert torch.allclose(
          torch.mean(res, axis=0), expected, atol=0.1, rtol=0
      )
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import qnode
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 2 for calling the TestShotsIntegration obj's underlying member method code with example usage: obj.test_gradient_integration() and returns: qml