class_docstr: Tests gradients of multivariate multidimensional functions.
docstr: Tests gradients with multivariate multidimensional linear func.
docstr_tok: ["Tests","gradients","with","multivariate","multidimensional","linear","func","."]
code: def test_linear(self, tol):
      """Tests gradients with multivariate multidimensional linear func."""
      x_vec = np.random.uniform(-5, 5, size=(2))
      x_vec_multidim = np.expand_dims(x_vec, axis=1)
  
      gradf = lambda x: np.array([[2 * x_[0]] for x_ in x])
      f = lambda x: np.sum([x_[0] ** 2 for x_ in x])
  
      g = qml.grad(f, 0)
      auto_grad = g(x_vec_multidim)
      correct_grad = gradf(x_vec_multidim)
      assert np.allclose(auto_grad, correct_grad, 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 TestGradientMultivarMultidim obj's underlying member method code with example usage: obj.test_linear(tol) without return types