(parameters, clip_value)
| 312 | return bn_group, feature_group, fc_group, normal_group |
| 313 | |
| 314 | def clip_grad_value(parameters, clip_value): |
| 315 | clip_value = float(clip_value) |
| 316 | for p in filter(lambda p: p.grad is not None, parameters): |
| 317 | p.grad.data.clamp_(min=-clip_value, max=clip_value) |
| 318 | |
| 319 | def compute_grad_norm(parameters): |
| 320 | parameters = list(filter(lambda p: p.grad is not None, parameters)) |
nothing calls this directly
no outgoing calls
no test coverage detected