code: def update_control_consumers(control_consumer_ops, old_op, new_op):
      """
      For each consumer's control inputs, replace old_op with new_op.
  
      Args:
          control_consumer_ops (List[Operation]): The control-dep consumer ops in the graph to be modified.
          old_op (Operation): The op whose link to its control-dep consumer will be removed
          new_op (Operation): The op which will replace old_op
      """
      for control_consumer_op in control_consumer_ops:
          control_inputs = list(control_consumer_op.control_inputs)
          size = len(control_inputs)
          control_inputs.remove(old_op)
          assert size - 1 == len(control_inputs)
          control_inputs.append(new_op)
          assert size == len(control_inputs)
          control_consumer_op._remove_all_control_inputs()
          control_consumer_op._add_control_inputs(control_inputs)
  
file_path: autodist/autodist/kernel/common/utils.py
imports: from collections import deque
  from tensorflow.core.framework.attr_value_pb2 import AttrValue
  from tensorflow.python.util.compat import as_bytes
  from autodist.const import AUTODIST_REPLICA_PREFIX, COLOCATION_PREFIX
label_desc: Use image node_id 11 for calling a global function with example usage: update_control_consumers(control_consumer_ops, old_op, new_op) without return types