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

Function _quantize_module

deepspeed/module_inject/module_quantize.py:62–71  ·  view source on GitHub ↗
(model, policies)

Source from the content-addressed store, hash-verified

60
61
62def _quantize_module(model, policies):
63 for name, child in model.named_children():
64 if child.__class__ in policies:
65 orig = repr(child)
66 setattr(model, name, policies[child.__class__](child))
67 new = getattr(model, name)
68 else:
69 _quantize_module(child, policies)
70
71 return model

Callers 3

_quantize_moduleMethod · 0.85
model_quantizeMethod · 0.85
quantize_moduleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected