Created
May 26, 2024 18:09
-
-
Save Gholamrezadar/b810ba72733c9ddea7cf075e53cadaa7 to your computer and use it in GitHub Desktop.
PyTorch Snippets
This file contains hidden or 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
# get the number of parameters of the model | |
def get_num_params(model): | |
return sum(p.numel() for p in model.parameters()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment