# skip the input and output of operators inserted in the reshard phase
dist_op=dist_context.get_dist_op_for_program(op)
ifdist_op:
forvar_nameinop.output_arg_names:
ifvar_namenotinsub_block_op_outputs:
sub_block_op_outputs.append(var_name)
forvar_nameinop.input_arg_names:
sub_block_op_inputs.add(var_name)
# NOTE: For op whose process mesh is a union, its input will not be renamed by other op reshard result now which means that it will have more reshard operation.
# NOTE: For op whose process mesh is a union, its input will not be renamed by other op reshard result now which means that it will have more reshard operation.