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: 3 additions & 0 deletions thop/profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import copy

from distutils.version import LooseVersion

from thop.vision.basic_hooks import *
Expand Down Expand Up @@ -151,6 +153,7 @@ def add_hooks(m):


def profile(model: nn.Module, inputs, custom_ops=None, verbose=True):
model = copy.deepcopy(model)
handler_collection = {}
types_collection = set()
if custom_ops is None:
Expand Down