MCPcopy Index your code
hub / github.com/RingBDStack/GDAP / assert_all_frozen

Function assert_all_frozen

seq2seq/utils.py:577–581  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

575
576
577def 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
584def assert_not_all_frozen(model):

Callers

nothing calls this directly

Calls 2

grad_statusFunction · 0.85
lmapFunction · 0.85

Tested by

no test coverage detected