code: def quantize(tensor, quant_range, clip_max):
      return np.floor(
          (
              np.clip(
                  tensor * quant_range / clip_max,
                  -quant_range,
                  quant_range,
              )
              + quant_range
          )
          + 0.5
      ).astype(np.ubyte)
  
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 1 for calling a global function with example usage: quantize(tensor, quant_range, clip_max) and returns: np