code: def Quantize(
      self, value_list, quantize_bits, groups, key, merge_dim=0
  ):
      if self.mlp_extra_grouping and self.is_mlp(
          value_list[0], merge_count=len(value_list)
      ):
          groups *= 2
      q_scale = []
      index = 0
      for data in value_list:
          data_int, data_scale = self.quantize_data(
              data, quantize_bits, groups, key
          )
          q_scale.append(data_scale)
          value_list[index] = data_int
          index += 1
      q_scale = 1 / torch.cat(q_scale, dim=merge_dim).to(
          torch.cuda.current_device()
      ).view(-1).unsqueeze(0)
      if "mlp.dense_4h_to_h.weight" in key:
          self.mlp4hh_scales.append(q_scale)
      elif "mlp.dense_h_to_4h.weight" in key:
          self.mlph4h_scales.append(q_scale)
      elif "attention.query_key_value.weight" in key:
          self.qkv_scales.append(q_scale)
      else:
          self.dense_scales.append(q_scale)
      return value_list
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/deepspeed/runtime/weight_quantizer.py
imports: import torch
  from ..module_inject.replace_policy import HFBertLayerPolicy, replace_policies
label_desc: Use image node_id 5 for calling the WeightQuantization obj's underlying member method code with example usage: obj.Quantize(value_list, quantize_bits, groups, key, merge_dim) and returns: value_list