code: def gather_quant_token_embedding(
      tensor_names, state_dict, tn_pattern, clip_max=None, ptq_mode=True
  ):
      target_tn = []
      for tn in tensor_names:
          if tn_pattern in tn.split("."):
              target_tn.append(tn)
              continue
      target_tensor = [state_dict[name] for name in target_tn]
      target_tensor = np.concatenate(target_tensor, axis=0)
      target_tensor = target_tensor.astype(np.float16).astype(
          np.float32
      )
      if clip_max is None:
          if ptq_mode:
              clip_max = get_kth_value(target_tensor)
          else:
              clip_max = target_tensor.flatten()[-1]
  
      target_tensor = quantize(
          target_tensor, global_quant_range, clip_max
      )
      return target_tensor, clip_max, target_tn
  
imports: from collections import OrderedDict
  import numpy
  from lightseq.training.ops.pytorch.util import get_pos_embedding
  from lightseq.training import LSTransformerEncoderLayer, LSTransformerDecoderLayer
  from lightseq.training.ops.pytorch.export import apply_rule
label_desc: Use image node_id 3 for calling a global function with example usage: gather_quant_token_embedding(tensor_names, state_dict, tn_pattern, clip_max, ptq_mode) and returns: target_tensor,  clip_max,  target_tn