code: def custom_quant(input, scale, unsigned=False):
      res = input.float() / scale
      if unsigned:
          res -= 127
      res = (res + 0.5).floor()
      res = res.clip(-127, 127)
      if unsigned:
          res += 127
      res = res * scale
      return res.to(input)
  
imports: import random
  import numpy
  import tensorflow
  import torch
  from lightseq.training.pytorch_quantization import tensor_quant
label_desc: Use image node_id 1 for calling a global function with example usage: custom_quant(input, scale, unsigned) and returns: res