docstr: Assign made-up gradient to test custom_gradient.
docstr_tok: ["Assign","made-up","gradient","to","test","custom_gradient","."]
code: def test_custom_gradient_chain_rule_one_scalar_var(self):
      """Assign made-up gradient to test custom_gradient."""
  
      def fun1_grad(x):
          return gs.array(3.0, dtype=x.dtype)
  
      @gs.autodiff.custom_gradient(fun1_grad)
      def fun1(x):
          return x
  
      def fun2(x):
          out = fun1(x) ** 2
          return out
  
      def fun2_grad(x):
          return 2 * x
  
      arg = gs.array(10.0)
  
      result_value, result_grad = gs.autodiff.value_and_grad(fun2)(arg)
      expected_value = fun2(arg)
      expected_grad_explicit = 60.0
  
      expected_grad_chain_rule = fun2_grad(fun1(arg)) * fun1_grad(arg)
  
      self.assertAllClose(result_value, expected_value)
      self.assertAllClose(result_grad, expected_grad_explicit)
      self.assertAllClose(result_grad, expected_grad_chain_rule)
  
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 15 for calling the TestAutodiff obj's underlying member method code with example usage: obj.test_custom_gradient_chain_rule_one_scalar_var() and returns: gs, x, out, unknown