Skip to content

Commit f0520f0

Browse files
Update interpolate.py: Adds support for Python version >= 3.10
Python deprecated collections.Sequence in favor of collections.abc.Sequence. The update checks for the Python version and uses collections.abc instead of collections for Python versions over 3.9
1 parent 36656b6 commit f0520f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torch2trt/converters/interpolate.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
from torch2trt.torch2trt import *
44
from torch2trt.module_test import add_module_test
55
import collections
6+
import sys
7+
if sys.version_info[0] == 3 and sys.version_info[1] >= 10:
8+
import collections.abc as collections
9+
else:
10+
import collections
611

712

813
def has_interpolate_plugin():

0 commit comments

Comments
 (0)