Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion thop/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def add_hooks(m):
def profile(
model: nn.Module,
inputs,
kwargs={},
custom_ops=None,
verbose=True,
ret_layer_info=False,
Expand Down Expand Up @@ -209,7 +210,7 @@ def add_hooks(m: nn.Module):
model.apply(add_hooks)

with torch.no_grad():
model(*inputs)
model(*inputs, **kwargs)

def dfs_count(module: nn.Module, prefix="\t") -> (int, int):
total_ops, total_params = module.total_ops.item(), 0
Expand Down