MCPcopy Create free account
hub / github.com/OpenGVLab/EfficientQAT / get_named_linears

Function get_named_linears

quantize/utils.py:100–102  ·  view source on GitHub ↗
(module, type)

Source from the content-addressed store, hash-verified

98
99
100def get_named_linears(module, type):
101 # return {name: m for name, m in module.named_modules() if isinstance(m, torch.nn.Linear)}
102 return {name: m for name, m in module.named_modules() if isinstance(m, type)}
103
104def set_op_by_name(layer, name, new_module):
105 levels = name.split('.')

Callers 2

block_apFunction · 0.90
load_quantized_modelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected