class_docstr: GradientTape using the unified API.
class_docstr_tok: ["GradientTape","using","the","unified","API","."]
code: def gradient(self, targets, sources, output_gradients=None):
      ctx = context_stack.get_default()
      flat_targets = nest.flatten(targets)
      flat_sources = nest.flatten(sources)
      out_grads = self._c_tape.ComputeGradient(
          ctx, flat_targets, flat_sources, output_gradients or []
      )
      return nest.pack_sequence_as(sources, out_grads)
  
file_path: tensorflow-upstream/tensorflow/python/framework/experimental/tape.py
imports: from tensorflow.python.framework.experimental import _tape
  from tensorflow.python.framework.experimental import context_stack
  from tensorflow.python.framework.experimental import gradient_registry
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling the GradientTape obj's underlying member method code with example usage: obj.gradient(targets, sources, output_gradients) and returns: nest