code: def quantize(input, scale, bits):
      """Do linear quantization to input according to a scale and number of bits"""
      thresh = calc_max_quant_value(bits)
      return input.mul(scale).round().clamp(-thresh, thresh)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from enum import Enum, auto
  import logging
  from abc import ABC, abstractmethod
  import torch
  from torch import nn
  from torch.nn import functional
  from nlp_architect.common import Config
label_desc: Use image node_id 4 for calling a global function with example usage: quantize(input, scale, bits) and returns: input