(model)
| 575 | |
| 576 | |
| 577 | def assert_all_frozen(model): |
| 578 | model_grads: List[bool] = list(grad_status(model)) |
| 579 | n_require_grad = sum(lmap(int, model_grads)) |
| 580 | npars = len(model_grads) |
| 581 | assert not any(model_grads), f"{n_require_grad / npars:.1%} of {npars} weights require grad" |
| 582 | |
| 583 | |
| 584 | def assert_not_all_frozen(model): |
nothing calls this directly
no test coverage detected