code: def remove_backword(program):
      """
      remove_backword
      """
      block = program.global_block()
      last_idx = -1
      for ids, op in list(enumerate(block.ops)):
          if op.has_attr("is_test"):
              op._set_attr("is_test", True)
      for ids, op in list(enumerate(block.ops)):
          if op._is_backward_op():
              last_idx = ids
              break
      last_idx -= 1  # remove fill_constant
      for ids, op in list(enumerate(block.ops)):
          if ids > last_idx:
              block._remove_op(last_idx + 1)
  
file_path: PGL/apps/PGLBox/src/distributed_program.py
imports: import copy
  import paddle
  import paddle.static
  from place import get_cuda_places
label_desc: Use image node_id 4 for calling a global function with example usage: remove_backword(program) without return types