code: def testMap_Grad(self):
      with self.cached_session():
          param = constant_op.constant(2.0)
          elems = constant_op.constant(
              [1.0, 2.0, 3.0, 4.0, 5.0, 6.0], name="elems"
          )
          y = map_fn.map_fn(
              lambda x: math_ops.multiply(math_ops.square(x), param),
              elems,
          )
          r_param = gradients_impl.gradients(y, param)[0]
          r_elems = gradients_impl.gradients(y, elems)[0]
          self.assertAllEqual(91.0, self.evaluate(r_param))
          self.assertAllEqual(
              [4.0, 8.0, 12.0, 16.0, 20.0, 24.0], self.evaluate(r_elems)
          )
  
imports: import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import map_fn
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  import tensorflow.python.ops.tensor_array_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 8 for calling the MapFnTest obj's underlying member method code with example usage: obj.testMap_Grad() without return types