code: def testSymbolicHigherOrderUnderTape(self, persistent):
      @polymorphic_function.function
      def f(x, order):
          with backprop.GradientTape(persistent=persistent) as tape:
              tape.watch(x)
              # Note that having a tape active, even if we don't use it, forces us
              # down a different function call path. Symbolic gradients should work
              # here too; correctness of tape gradients are tested elsewhere.
              y = polymorphic_function.function(
                  lambda: math_ops.cos(x)
              )()
          tape_dy = tape.gradient(y, x)
          for _ in range(order):
              (y,) = gradients_impl.gradients(y, [x])
          if order > 0:
              y1 = tape_dy
              for _ in range(order - 1):
                  (y1,) = gradients_impl.gradients(y1, [x])
          else:
              y1 = y
          return y, y1
  
      for order, expected_f in enumerate(_COS_DERIVATIVES):
          expected = self.evaluate(
              expected_f(constant_op.constant(1.0))
          )
          self.assertAllClose(
              (expected, expected), f(constant_op.constant(1.0), order)
          )
  
imports: from absl.testing import parameterized
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_grad
  from tensorflow.python.ops import nn_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 import while_loop
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the FunctionGradientsTest obj's underlying member method code with example usage: obj.testSymbolicHigherOrderUnderTape(persistent) and returns: y,  y1