class_docstr: Tests that the template is compatible with all interfaces, including the computation
  of gradients.
docstr: Tests the autograd interface.
docstr_tok: ["Tests","the","autograd","interface","."]
code: def test_autograd(self, tol):
      """Tests the autograd interface."""
  
      weights = np.random.random(size=(1, 2, 2))
      weights = pnp.array(weights, requires_grad=True)
      initial_weights = np.random.random(size=(3,))
      initial_weights = pnp.array(initial_weights, requires_grad=True)
  
      dev = qml.device("default.qubit", wires=3)
  
      circuit = qml.QNode(circuit_template, dev)
      circuit2 = qml.QNode(circuit_decomposed, dev)
  
      res = circuit(initial_weights, weights)
      res2 = circuit2(initial_weights, weights)
      assert qml.math.allclose(res, res2, atol=tol, rtol=0)
  
      grad_fn = qml.grad(circuit)
      grads = grad_fn(initial_weights, weights)
  
      grad_fn2 = qml.grad(circuit2)
      grads2 = grad_fn2(initial_weights, weights)
  
      assert np.allclose(grads[0], grads2[0], atol=tol, rtol=0)
      assert np.allclose(grads[1], grads2[1], atol=tol, rtol=0)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestInterfaces obj's underlying member method code with example usage: obj.test_autograd(tol) without return types