code: def _cache_mem(curr_out, prev_mem, mem_len=None):
      if mem_len is None or prev_mem is None:
          new_mem = curr_out
      elif mem_len == 0:
          return prev_mem
      else:
          new_mem = tf.concat([prev_mem, curr_out], 0)[-mem_len:]
  
      return tf.stop_gradient(new_mem)
  
file_path: delta/gcompiler/example/python/nlp_transformer/model.py
imports: import tensorflow
label_desc: Use image node_id 11 for calling a global function with example usage: _cache_mem(curr_out, prev_mem, mem_len) and returns: tf, prev_mem