class_docstr: Tests gradients of univariate functions with multiple arguments in signature.
docstr: Tests multiarg gradients with exp and tanh functions.
docstr_tok: ["Tests","multiarg","gradients","with","exp","and","tanh","functions","."]
code: def test_exp(self, tol):
      """Tests multiarg gradients with exp and tanh functions."""
      x = -2.5
      y = 1.5
      gradf = lambda x, y: (
          np.exp(x / 3) / 3 * np.tanh(y),
          np.exp(x / 3) * (1 - np.tanh(y) ** 2),
      )
      f = lambda x, y: np.exp(x / 3) * np.tanh(y)
  
      # gradient wrt first argument
      gx = qml.grad(f, 0)
      auto_gradx = gx(x, y)
      correct_gradx = gradf(x, y)[0]
      assert np.allclose(auto_gradx, correct_gradx, atol=tol, rtol=0)
  
      # gradient wrt second argument
      gy = qml.grad(f, 1)
      auto_grady = gy(x, y)
      correct_grady = gradf(x, y)[1]
      assert np.allclose(auto_grady, correct_grady, atol=tol, rtol=0)
  
      # gradient wrt both arguments
      gxy = qml.grad(f, [0, 1])
      auto_gradxy = gxy(x, y)
      correct_gradxy = gradf(x, y)
      assert np.allclose(auto_gradxy, correct_gradxy, atol=tol, rtol=0)
  
imports: import autograd
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestGradientMultiargs obj's underlying member method code with example usage: obj.test_exp(tol) without return types