Skip to content

Commit

Permalink
Remove an unnecessary list creation in profiler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bryant1410 authored and rwightman committed May 9, 2024
1 parent 2f5a8f4 commit d2f2aea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/training/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def profile_torch(model, text_input_size, image_input_size, batch_size=1, force_


def count_params(model):
return sum([m.numel() for m in model.parameters()])
return sum(m.numel() for m in model.parameters())

def profile_model(model_name, batch_size=1, profiler='torch'):
assert profiler in ['torch', 'fvcore'], 'Only torch and fvcore profilers are supported'
Expand Down

0 comments on commit d2f2aea

Please sign in to comment.