Created
May 13, 2022 05:43
-
-
Save konverner/7445190a9dd187d060b1ec14fb72d2e9 to your computer and use it in GitHub Desktop.
count parameters of pytorch model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def count_parameters(model): | |
return sum(p.numel() for p in model.parameters() if p.requires_grad) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment