code: def replace_atenops_to_gather(model: ModelProto) -> ModelProto:
      """
      Replaces broken ATenOp nodes back to Gather nodes.
  
      Args:
          model (`onnx.ModelProto`):
              The ONNX model to fix.
  
      Returns:
          `onnx.ModelProto`: The ONNX model fixed.
      """
      nodes = model.graph.node
  
      for node in nodes:
          if node.op_type in ["ATenOp", "ATen"]:
              op_num = node.name.split("_")[-1]
              new_node = onnx.helper.make_node(
                  "Gather",
                  name="Gather_" + op_num,
                  inputs=[node.input[0], node.input[1]],
                  outputs=node.output,
              )
  
              model.graph.node.remove(node)
              model.graph.node.insert(int(op_num), new_node)
  
      onnx.checker.check_model(model)
      return model
  
file_path: optimum/optimum/onnx/graph_transformations.py
imports: import copy
  import os
  from pathlib import Path
  from typing import TYPE_CHECKING, List, Optional, Union
  import onnx
  from onnx import ModelProto
  from ..utils import logging
  from .transformations_utils import _create_name_sharing_dict, _deduplicate_gather_matmul, _deduplicated_cross_model_initializers, _find_duplicate_initializers, _find_matching_initializers, _get_all_inputs, _get_onnx_opset, _get_weights_to_tie, _remove_redundant_initializers, _replace_input_names, _unify_onnx_outputs, cast_int64_tensorproto_to_int32
label_desc: Use image node_id 3 for calling a global function with example usage: replace_atenops_to_gather(model) and returns: model