code: def strip_pop_ops(program):
      # Why might this be useful?  Because a variable waiting to be popped by an
      # explicit PopOp registers as "live" to the liveness analysis, which causes it
      # to demand a heavier allocation strategy than it actually deserves.  For an
      # example of the difference this can make, compare the answers in
      # `testAllocatingIsEvenProgram` and `testAllocatingIsEvenProgramNoPops`.
      def walk_graph(graph):
          for i in range(graph.exit_index()):
              block = graph.block(i)
              block.instructions = [
                  op
                  for op in block.instructions
                  if not isinstance(op, inst.PopOp)
              ]
  
      walk_graph(program.graph)
      for func in program.functions:
          walk_graph(func.graph)
  
file_path: probability/tensorflow_probability/python/experimental/auto_batching/allocation_strategy_test.py
imports: from tensorflow_probability.python.experimental.auto_batching import allocation_strategy
  from tensorflow_probability.python.experimental.auto_batching import instructions
  from tensorflow_probability.python.experimental.auto_batching import test_programs
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 1 for calling a global function with example usage: strip_pop_ops(program) without return types