(model, requires_grad)
| 23 | |
| 24 | |
| 25 | def 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 | |
| 32 | def weight_parameters(model): |
| 33 | params = [] |