code: def test_quantized_linear(self, quantization_bits, group_dim):
      reset_random()
  
      layers = []
  
      for idx in range(5):
          layers.append(
              (
                  f"layer_{idx}",
                  nn.Linear(
                      in_features=128,
                      out_features=128,
                      dtype=torch.float16,
                      device=device,
                  ),
              )
          )
  
      input_tensor = torch.randn(
          32, 128, dtype=torch.float16, device=device
      )
      with torch.no_grad():
          model = nn.Sequential(OrderedDict(layers))
  
          ref_output = model(input_tensor)
  
          ds_config = {
              "weight_quantization": {
                  "post_init_quant": {
                      "layer": {
                          "num_bits": quantization_bits,
                          "group_size": 64,
                          "group_dim": group_dim,
                          "symmetric": False,
                      }
                  }
              }
          }
  
          model = _init_group_wise_weight_quantization(model, ds_config)
  
          assert type(model.layer_0) is QuantizedLinear
          assert type(model.layer_1) is QuantizedLinear
          assert type(model.layer_2) is QuantizedLinear
          assert type(model.layer_3) is QuantizedLinear
          assert type(model.layer_4) is QuantizedLinear
  
          output = model(input_tensor)
  
          mean_diff = torch.mean(torch.abs(ref_output - output))
  
          # This threshold value is emperically selected.
          assert (
              mean_diff < 0.15
          ), f"Numeric error exceed threshold, mean diff {mean_diff}"
  
imports: import numpy
  import torch
  import torch.nn
  from unit.common import DistributedTest
  from deepspeed.accelerator import get_accelerator
  from deepspeed.inference.quantization.quantization import _init_group_wise_weight_quantization
  from deepspeed.inference.quantization.utils import Quantizer, DeQuantizer
  from deepspeed.inference.quantization.layers import QuantizedLinear
  from deepspeed.runtime.utils import required_torch_version
  from transformers.models.opt.modeling_opt import OPTDecoderLayer
  from transformers import AutoConfig, OPTConfig, AutoModel
  import pytest
  from collections import OrderedDict
  from typing import Dict
label_desc: Use image node_id 2 for calling the TestQuantizedInt obj's underlying member method code with example usage: obj.test_quantized_linear(quantization_bits, group_dim) without return types