code: def capture_ops():
      """Decorator to capture ops created in the block.
      with capture_ops() as ops:
        # create some ops
      print(ops) # => prints ops created.
      """
  
      micros = int(time.time() * 10**6)
      scope_name = str(micros)
      op_list = []
      with tf.compat.v1.name_scope(scope_name):
          yield op_list
  
      g = tf.compat.v1.get_default_graph()
      op_list.extend(ge.select_ops(scope_name + "/.*", graph=g))
  
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 7 for calling a global function with example usage: capture_ops() without return types