Skip to content

Commit

Permalink
fix a wrong check on torch version
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Dec 28, 2021
1 parent 4aacd11 commit 4a15692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchpruner/model_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,6 @@ def replace_object_by_class(

def normalize_onnx_parameters(**kwargs):
torch_version = torch.__version__.split(".")
if torch_version[0] > "2" or len(torch_version) > 1 and torch_version[1] >= "10":
if int(torch_version[0]) >= 2 or len(torch_version) > 1 and int(torch_version[1]) >= 10:
kwargs.pop("_retain_param_name", None)
return kwargs

0 comments on commit 4a15692

Please sign in to comment.