class_docstr: Tests gradients of univariate functions with multiple arguments in signature.
docstr: Tests multiarg gradients with a linear function.
docstr_tok: ["Tests","multiarg","gradients","with","a","linear","function","."]
code: def test_linear(self, tol):
      """Tests multiarg gradients with a linear function."""
      x = -2.5
      y = 1.5
      gradf = lambda x, y: (2 * x, 2 * y)
      f = lambda x, y: np.sum([x_**2 for x_ in [x, 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 3 for calling the TestGradientMultiargs obj's underlying member method code with example usage: obj.test_linear(tol) without return types