MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / get_named_linears

Function get_named_linears

test/test_utils.py:12–13  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

10
11# from ppq.core import CUDA
12def get_named_linears(module):
13 return {name: m for name, m in module.named_modules() if isinstance(m, nn.Linear)}
14
15def get_named_bnb_linears(module):
16 return {name: m for name, m in module.named_modules() if isinstance(m, bnb.nn.Linear4bit)}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected