Skip to content

Instantly share code, notes, and snippets.

@dangne
Created March 2, 2021 08:24
Show Gist options
  • Save dangne/4be0ce1ef0afcc4ac4e4d6ef10ec393f to your computer and use it in GitHub Desktop.
Save dangne/4be0ce1ef0afcc4ac4e4d6ef10ec393f to your computer and use it in GitHub Desktop.
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