class_docstr: Unit tests for the gradient function
docstr: Test that the intermediate forward pass value is accessible and correct
docstr_tok: ["Test","that","the","intermediate","forward","pass","value","is","accessible","and","correct"]
code: def test_forward_pass_value_storing(self, tol):
      """Test that the intermediate forward pass value is accessible and correct"""
  
      def cost(x):
          return np.sum(np.sin(x) * x[0] ** 3)
  
      grad_fn = qml.grad(cost)
      params = np.array([-0.654, 1.0, 2.0], requires_grad=True)
  
      assert grad_fn.forward is None
  
      grad_fn(params)
  
      res = grad_fn.forward
      expected = cost(params)
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
      # change the parameters
      params2 = np.array([1.4, 1.0, 2.0], requires_grad=True)
      grad_fn(params2)
  
      res = grad_fn.forward
      expected = cost(params2)
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
imports: import autograd
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 3 for calling the TestGrad obj's underlying member method code with example usage: obj.test_forward_pass_value_storing(tol) and returns: np