code: def __init__(
      self, config, in_features, out_features, has_bias, tensors, key
  ):
      self.config = config
      self.key = key
      self.in_features = in_features
      self.out_features = out_features
  
      self.qweight = tensors[key + ".qweight"]
      self.qzeros = tensors[key + ".qzeros"]
      self.scales = tensors[key + ".scales"]
      self.g_idx = (
          tensors[key + ".g_idx"].cpu()
          if key + ".g_idx" in tensors
          else None
      )
      self.bias = tensors[key + ".bias"] if has_bias else None
  
      if self.g_idx is not None and (self.g_idx == 0).all():
          self.config.empty_g_idx = True
          self.g_idx = None
  
      self.device = self.qweight.device
      self.device_index = self.device.index
  
      self.q4 = cuda_ext.ext_make_q4(
          self.qweight,
          self.qzeros,
          self.scales,
          self.g_idx,
          self.device_index,
      )
  
      self.height = tensors[key + ".qweight"].shape[0] * 8
      self.width = tensors[key + ".qweight"].shape[1]
  
      # Infer groupsize from height of qzeros
  
      self.groupsize = None
      if self.qzeros.shape[0] > 1:
          self.groupsize = (
              self.qweight.shape[0] * 8
          ) // self.qzeros.shape[0]
          if self.config.groupsize is None:
              self.config.groupsize = self.groupsize
  
      # Handle act-order matrix
  
      if self.g_idx is not None:
          if self.groupsize is None:
              raise ValueError(
                  "Found group index but no groupsize. What do?"
              )
          self.config.act_order = True
  
imports: import sys
  import torch
  from torch import nn
  import torch.nn.functional
  from safetensors import safe_open
  import cuda_ext
  import json
  import math
  import gc
  from enum import Enum
label_desc: Use image node_id 1 to create a new Ex4bitLinear object  with example: obj = Ex4bitLinear(config, in_features, out_features, has_bias, tensors, key)