class_docstr: Test autograd works with the new tensor subclass
class_docstr_tok: ["Test","autograd","works","with","the","new","tensor","subclass"]
docstr: Test gradient computation with requires_grad=False raises an error
docstr_tok: ["Test","gradient","computation","with","requires_grad=False","raises","an","error"]
code: def test_non_differentiable_gradient(self):
      """Test gradient computation with requires_grad=False raises an error"""
  
      def cost(x):
          return np.sum(np.sin(x))
  
      grad_fn = qml.grad(cost, argnum=[0])
      arr1 = np.array([0.0, 1.0, 2.0], requires_grad=False)
  
      with pytest.raises(
          np.NonDifferentiableError, match="non-differentiable"
      ):
          grad_fn(arr1)
  
imports: import numpy
  import pytest
  from autograd.numpy.numpy_boxes import ArrayBox
  import pennylane
  from pennylane import numpy
  from pennylane.numpy.tensor import tensor_to_arraybox
label_desc: Use image node_id 2 for calling the TestAutogradIntegration obj's underlying member method code with example usage: obj.test_non_differentiable_gradient() and returns: np