-
Notifications
You must be signed in to change notification settings - Fork 22.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Return Number of Model Parameters #3166
Comments
this can be trivially done with a line of code.
I dont see any benefit of having an extra function for this. |
This will not work for any model. for example:
|
@dpappas that's because |
Perfect! Thank you very much. |
Would be nice to call
model.num_params()
and be able to obtain the number of trainable parameters of a model. Especially useful during model summary printing. The PR should probably reference this: https://discuss.pytorch.org/t/finding-the-total-number-of-trainable-parameters-in-a-graph/1751/2The text was updated successfully, but these errors were encountered: