Skip to content

Instantly share code, notes, and snippets.

@konverner
Last active August 3, 2021 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konverner/e75a32c672c6c8bd22b6f893f1002272 to your computer and use it in GitHub Desktop.
Save konverner/e75a32c672c6c8bd22b6f893f1002272 to your computer and use it in GitHub Desktop.
Get a number of parameters in pytorch model
print(sum(p.numel() for p in model.parameters() if p.requires_grad)*NUM_MODELS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment