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

Function set_weight_parameters

quantize/utils.py:25–30  ·  view source on GitHub ↗
(model, requires_grad)

Source from the content-addressed store, hash-verified

23
24
25def set_weight_parameters(model, requires_grad):
26 params = []
27 for n, m in model.named_parameters():
28 if n.find('weight') > -1 and not (n.find('scale') > -1 or n.find('zero_point') > -1):
29 m.requires_grad = requires_grad
30 return iter(params)
31
32def weight_parameters(model):
33 params = []

Callers 1

block_apFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected