code: def export_ls_encoder(
      file, state_dict, hidden_size, intermediate_size, save_pb=True
  ):
      hs, ims = hidden_size, intermediate_size
      offsets = LSTransformerEncoderLayer.gen_offset(hs, ims)
      mapping_dict = OrderedDict(
          {
              "multihead_project_kernel_qkv": "para&&expression_[{0}:{1}].reshape({2}, {3}).transpose(0, 1)".format(
                  offsets[0], offsets[1], 3 * hs, hs
              ),
              "multihead_project_bias_qkv": "para&&expression_[{0}:{1}]".format(
                  offsets[1], offsets[2]
              ),
              "multihead_project_kernel_output": "para&&expression_[{0}:{1}].reshape({2}, {3}).transpose(0, 1)".format(
                  offsets[2], offsets[3], hs, hs
              ),
              "multihead_project_bias_output": "para&&expression_[{0}:{1}]".format(
                  offsets[3], offsets[4]
              ),
              "multihead_norm_scale": "para&&expression_[{0}:{1}]".format(
                  offsets[4], offsets[5]
              ),
              "multihead_norm_bias": "para&&expression_[{0}:{1}]".format(
                  offsets[5], offsets[6]
              ),
              "ffn_first_kernel": "para&&expression_[{0}:{1}].reshape({2}, {3}).transpose(0, 1)".format(
                  offsets[6], offsets[7], ims, hs
              ),
              "ffn_first_bias": "para&&expression_[{0}:{1}]".format(
                  offsets[7], offsets[8]
              ),
              "ffn_second_kernel": "para&&expression_[{0}:{1}].reshape({2}, {3}).transpose(0, 1)".format(
                  offsets[8], offsets[9], hs, ims
              ),
              "ffn_second_bias": "para&&expression_[{0}:{1}]".format(
                  offsets[9], offsets[10]
              ),
              "ffn_norm_scale": "para&&expression_[{0}:{1}]".format(
                  offsets[10], offsets[11]
              ),
              "ffn_norm_bias": "para&&expression_[{0}:{1}]".format(
                  offsets[11], offsets[12]
              ),
          }
      )
      fill_encdec_weight(file, state_dict, mapping_dict, True, save_pb)
  
file_path: lightseq/lightseq/training/ops/pytorch/export.py
imports: from collections import OrderedDict
  import numpy
  from lightseq.training.ops.pytorch.util import get_pos_embedding
  from lightseq.training import LSTransformerEncoderLayer, LSTransformerDecoderLayer
label_desc: Use image node_id 7 for calling a global function with example usage: export_ls_encoder(file, state_dict, hidden_size, intermediate_size, save_pb) without return types