MCPcopy Create free account
hub / github.com/bytedance/ABQ-LLM / clear_temp_variable

Function clear_temp_variable

algorithm/quantize/utils.py:136–142  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

134 module.use_temporary_parameter=True
135
136def clear_temp_variable(model):
137 for name, module in model.named_modules():
138 if isinstance(module, QuantLinear):
139 if hasattr(module, "temp_weight"):
140 del module.temp_weight
141 if hasattr(module, "temp_bias"):
142 del module.temp_bias
143
144@torch.no_grad()
145def smooth_and_quant_inplace(model, args, isllama):

Callers 1

abqllmFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected