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

Function _quantize_module

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

Source from the content-addressed store, hash-verified

61
62
63def _quantize_module(model, policies):
64 for name, child in model.named_children():
65 if child.__class__ in policies:
66 orig = repr(child)
67 setattr(model, name, policies[child.__class__](child))
68 new = getattr(model, name)
69 else:
70 _quantize_module(child, policies)
71
72 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