code: def _get_encode_output_mapping_dict(dec_layer_num):
      encode_output_kernel_pattern = [
          "{0} encoder_attn k_proj weight&&{0} encoder_attn v_proj weight".format(
              ele
          )
          for ele in range(dec_layer_num)
      ]
      encode_output_bias_pattern = [
          "{0} encoder_attn k_proj bias&&{0} encoder_attn v_proj bias".format(
              ele
          )
          for ele in range(dec_layer_num)
      ]
  
      return {
          "encode_output_project_kernel_kv": "&&".join(
              encode_output_kernel_pattern
              + ["expression_.transpose(0, 1)"]
          ),
          "encode_output_project_bias_kv": "&&".join(
              encode_output_bias_pattern
          ),
      }
  
file_path: lightseq/examples/inference/python/export/fairseq/native_fs_moe_transformer_export.py
imports: import os
  import torch
  import argparse
  import numpy
  from collections import OrderedDict
  import lightseq.inference
  from proto.moe_pb2 import Moe
  from lightseq.training.ops.pytorch.export import gather_token_embedding, export_ls_config
  from lightseq.training.ops.pytorch.util import get_pos_embedding
label_desc: Use image node_id 4 for calling a global function with example usage: _get_encode_output_mapping_dict(dec_layer_num) and returns: dict