MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __init__

Method __init__

deepspeed/inference/quantization/utils.py:50–54  ·  view source on GitHub ↗
(self, config: Dict)

Source from the content-addressed store, hash-verified

48class Quantizer:
49
50 def __init__(self, config: Dict) -> None:
51 self.config = config
52 assert self.config['num_bits'] == 4 or self.config[
53 'num_bits'] == 8, 'Only INT4 and INT8 quantization is supported.'
54 assert self.config['symmetric'] == False, 'Only asymmetric quantization is supported at this moment.'
55
56 def quantize(self, tensor: Tensor) -> Tuple[Tensor, Tensor, Tensor]:
57 assert tensor.shape[self.config['group_dim']] % self.config['group_size'] == 0 \

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected