code: def from_float(module: torch.nn.Linear, input_scale, output_scale):
      int8_module = W8A8B8O8Linear(
          module.in_features, module.out_features
      )
      int8_weight, weight_scale = quantize_per_tensor_absmax(
          module.weight
      )
      alpha = input_scale * weight_scale / output_scale
      int8_module.weight = int8_weight
      int8_module.a = alpha
  
      if module.bias is not None:
          int8_bias, bias_scale = quantize_per_tensor_absmax(
              module.bias
          )
          int8_module.bias = int8_bias
          beta = bias_scale / output_scale
          int8_module.b = beta
  
      return int8_module
  
file_path: colossalai/colossalai/inference/quant/smoothquant/models/linear.py
imports: import torch
label_desc: Use image node_id 4 for calling the W8A8B8O8Linear obj's underlying member method code with example usage: obj.from_float(module, input_scale, output_scale) and returns: int8_module