code: def test_custom_gradient_in_action(self):
      space = SpecialEuclidean(n=2)
      const_metric = space.metric
      const_point_b = space.random_point()
  
      def func(x):
          return const_metric.squared_dist(x, const_point_b)
  
      arg_point_a = space.random_point()
      func_with_grad = gs.autodiff.value_and_grad(func)
      result_value, result_grad = func_with_grad(arg_point_a)
      expected_value = const_metric.squared_dist(
          arg_point_a, const_point_b
      )
      expected_grad = -2 * const_metric.log(const_point_b, arg_point_a)
  
      self.assertAllClose(result_value, expected_value)
      self.assertAllClose(result_grad, expected_grad)
  
      loss, grad = func_with_grad(const_point_b)
      self.assertAllClose(loss, 0.0)
      self.assertAllClose(grad, gs.zeros_like(grad))
  
imports: import warnings
  import numpy
  import pytest
  import geomstats.backend
  from geomstats.geometry.grassmannian import Grassmannian
  from geomstats.geometry.special_euclidean import SpecialEuclidean
  from geomstats.test.test_case import TestCase, autograd_and_torch_only, autograd_only, np_only
label_desc: Use image node_id 18 for calling the TestAutodiff obj's underlying member method code with example usage: obj.test_custom_gradient_in_action() and returns: const_metric