class_docstr: Tests gradients of multivariate multidimensional functions.
docstr: Tests gradients with multivariate multidimensional sin and cos.
docstr_tok: ["Tests","gradients","with","multivariate","multidimensional","sin","and","cos","."]
code: def test_sin(self, tol):
      """Tests gradients with multivariate multidimensional sin and cos."""
      x_vec = np.random.uniform(-5, 5, size=(2))
      x_vec_multidim = np.expand_dims(x_vec, axis=1)
  
      gradf = lambda x: ([[np.cos(x[0, 0])], [-np.sin(x[[1]])]])
      f = lambda x: np.sin(x[0, 0]) + np.cos(x[1, 0])
  
      g = qml.grad(f, 0)
      auto_grad = g(x_vec_multidim)
      correct_grad = gradf(x_vec_multidim)
      assert np.allclose(
          auto_grad[0], correct_grad[0], atol=tol, rtol=0
      )
      assert np.allclose(
          auto_grad[1], correct_grad[1], atol=tol, rtol=0
      )
  
imports: import autograd
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestGradientMultivarMultidim obj's underlying member method code with example usage: obj.test_sin(tol) without return types