MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / is_quantable

Function is_quantable

imperative/python/megengine/quantization/quantize.py:23–29  ·  view source on GitHub ↗
(key: str)

Source from the content-addressed store, hash-verified

21
22def _get_quantable_module_names():
23 def is_quantable(key: str):
24 value = getattr(Quantized, key)
25 return (
26 isinstance(value, type)
27 and issubclass(value, QuantizedModule)
28 and value != QuantizedModule
29 )
30
31 # source should have all quantable modules' names
32 quantable_module_names = [key for key in dir(Quantized) if is_quantable(key)]

Callers 2

quantize_qatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected