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

Function get_op_by_name

quantization/clip_utils.py:159–164  ·  view source on GitHub ↗
(module, op_name)

Source from the content-addressed store, hash-verified

157 return {name: m for name, m in module.named_modules() if isinstance(m, nn.Linear)}
158
159def get_op_by_name(module, op_name):
160 # get the op by its name relative to the module
161 for name, m in module.named_modules():
162 if name == op_name:
163 return m
164 raise ValueError(f"Cannot find op {op_name} in module {module}")
165
166def get_op_name(module, op):
167 # get the name of the op relative to the module

Callers 1

apply_clipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected