code: def quantize_highbit(self, inputs, num_bits):
      q_range = 2**num_bits
      input_flat = inputs.reshape(self.q_groups, -1)
      g_min = input_flat.amin(dim=-1, keepdim=True)
      g_max = input_flat.amax(dim=-1, keepdim=True)
  
      # Random number generator (Uniform)
      if self.q_rounding == "nearest":
          p = 0.0
      else:
          p = input_flat.new(input_flat.shape).uniform_(-0.5, 0.5)
  
      if self.q_type == "symmetric":
          scale = (
              2
              * torch.max(torch.abs(g_min), torch.abs(g_max))
              / q_range
          )
          zero_point = 0.0
          input_flat = (input_flat / scale + p).round().clamp(
              -(q_range >> 1), (q_range >> 1) - 1
          ) * scale
      elif self.q_type == "asymmetric":
          scale = (g_max - g_min) / q_range
          zero_point = (g_min / scale).round() * scale
          input_flat = (
              (input_flat - zero_point) / scale + p
          ).round().clamp(0, (q_range - 1)) * scale + zero_point
      output = input_flat.reshape(inputs.shape).contiguous()
      return output
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/deepspeed/runtime/quantize.py
imports: import torch
  import math
  from deepspeed.utils import logger
  from deepspeed.ops.quantizer import ds_quantizer
label_desc: Use image node_id 5 for calling the Quantizer obj's underlying member method code with example usage: obj.quantize_highbit(inputs, num_bits) and returns: output