code: def _to_op(tensor_or_op):
      if hasattr(tensor_or_op, "op"):
          return tensor_or_op.op
      return tensor_or_op
  
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 8 for calling a global function with example usage: _to_op(tensor_or_op) and returns: tensor_or_op, tensor_or_op