code: def test_merge_decoders(self, *args):
      model_id, task = args
  
      with TemporaryDirectory() as tmpdir:
          main_export(
              model_id,
              tmpdir,
              task=task,
              no_post_process=True,
              legacy=True,
          )
  
          decoder = onnx.load(
              os.path.join(tmpdir, "decoder_model.onnx")
          )
          decoder_with_past = onnx.load(
              os.path.join(tmpdir, "decoder_with_past_model.onnx")
          )
          merged_path = os.path.join(
              tmpdir, "decoder_model_merged.onnx"
          )
  
          merge_decoders(
              decoder,
              decoder_with_past,
              save_path=merged_path,
              strict=False,
          )
  
          # ONNX Runtime does additional validity checks compared to onnx.checker.check_model
          InferenceSession(
              merged_path, providers=["CPUExecutionProvider"]
          )
  
imports: import os
  import subprocess
  import unittest
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from unittest import TestCase
  import huggingface_hub
  import numpy
  import onnx
  import torch
  from onnx import load
  from onnxruntime import InferenceSession
  from parameterized import parameterized
  from transformers import AutoModel, AutoTokenizer
  from optimum.exporters.onnx import main_export
  from optimum.onnx.graph_transformations import cast_slice_nodes_inputs_to_int32, merge_decoders, remove_duplicate_weights
label_desc: Use image node_id 1 for calling the OnnxMergingTestCase obj's underlying member method code with example usage: obj.test_merge_decoders() without return types