Skip to content

Commit

Permalink
switch from distutils to packaging PEP 632
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Zagoruyko committed Dec 30, 2024
1 parent 5cf04c1 commit 8d41628
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
zip_safe=True,

install_requires=[
'packaging',
'torch',
'graphviz'
]
Expand Down
4 changes: 2 additions & 2 deletions torchviz/dot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import namedtuple
from distutils.version import LooseVersion
from packaging.version import Version
from graphviz import Digraph
import torch
from torch.autograd import Variable
Expand Down Expand Up @@ -62,7 +62,7 @@ def make_dot(var, params=None, show_attrs=False, show_saved=False, max_attr_char
max_attr_chars: if show_attrs is `True`, sets max number of characters
to display for any given attribute.
"""
if LooseVersion(torch.__version__) < LooseVersion("1.9") and \
if Version(torch.__version__) < Version("1.9") and \
(show_attrs or show_saved):
warnings.warn(
"make_dot: showing grad_fn attributes and saved variables"
Expand Down

0 comments on commit 8d41628

Please sign in to comment.