code: def gradients_speed(ys, xs, grad_ys=None, **kwargs):
      return gradients(ys, xs, grad_ys, checkpoints="speed", **kwargs)
  
file_path: gpt-2-simple/gpt_2_simple/src/memory_saving_gradients.py
imports: from toposort import toposort
  import contextlib
  import numpy
  import tensorflow
  import time
  import sys
  from tensorflow.python.ops import gradients
label_desc: Use image node_id 1 for calling a global function with example usage: gradients_speed(ys, xs, grad_ys) and returns: gradients