code: def inject_lightseq_layer(model, training_args, config):
      # encoder op replace
      model = model.model
      for layer_id in range(config.encoder_layers):
          enc_config, enc_params_list = get_enc_layer_config(
              training_args, config
          )
          model.encoder.layers[
              layer_id
          ] = LSHFTransformerEncoderLayer.build_model(
              enc_config,
              enc_params_list,
              model.encoder.layers,
              layer_id,
          ).cuda()
      # decoder op replace
      for layer_id in range(config.decoder_layers):
          dec_config, dec_params_list = get_dec_layer_config(
              training_args, config
          )
          model.decoder.layers[
              layer_id
          ] = LSHFTransformerDecoderLayer.build_model(
              dec_config,
              dec_params_list,
              model.decoder.layers,
              layer_id,
              training_args.per_device_eval_batch_size,
          ).cuda()
  
imports: import torch
  from torch import nn
  from dataclasses import dataclass
  from lightseq.training.ops.pytorch.transformer_encoder_layer import LSTransformerEncoderLayer
  from lightseq.training.ops.pytorch.transformer_decoder_layer import LSTransformerDecoderLayer
  from lightseq.training.ops.pytorch.quantization import weight_quant_config, act_quant_config, relu_quant_config
  from transformers import BartPretrainedModel, BartForConditionalGeneration, BartForSequenceClassification, BartForQuestionAnswering
  from transformers.models.bart.modeling_bart import BartEncoderLayer, BartDecoderLayer
label_desc: Use image node_id 5 for calling a global function with example usage: inject_lightseq_layer(model, training_args, config) without return types