Skip to content

Commit 6530e57

Browse files
committed
fix bugs
1 parent 1b21c9b commit 6530e57

File tree

1 file changed

+8
-8
lines changed
  • py/torch_tensorrt/dynamo/conversion/impl

1 file changed

+8
-8
lines changed

py/torch_tensorrt/dynamo/conversion/impl/pad.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def constant_padNd(
3232

3333
rank = len(input.shape)
3434

35-
if len(pad) / 2 > rank:
35+
if len(pad) // 2 > rank:
3636
raise RuntimeError(
37-
f"Trying to pad last {len(pad) / 2} dimension but the input only has {rank} dimension."
37+
f"Trying to pad last {len(pad) // 2} dimension but the input only has {rank} dimension."
3838
)
3939

4040
start_list = [0] * len(input.shape)
@@ -72,9 +72,9 @@ def reflection_padNd(
7272

7373
rank = len(input.shape)
7474

75-
if len(padding) / 2 > rank:
75+
if len(padding) // 2 > rank:
7676
raise RuntimeError(
77-
f"Trying to pad last {len(padding) / 2} dimension but the input only has {rank} dimension."
77+
f"Trying to pad last {len(padding) // 2} dimension but the input only has {rank} dimension."
7878
)
7979

8080
start_list = [0] * len(input.shape)
@@ -110,9 +110,9 @@ def replication_padNd(
110110

111111
rank = len(input.shape)
112112

113-
if len(padding) / 2 > rank:
113+
if len(padding) // 2 > rank:
114114
raise RuntimeError(
115-
f"Trying to pad last {len(padding) / 2} dimension but the input only has {rank} dimension."
115+
f"Trying to pad last {len(padding) // 2} dimension but the input only has {rank} dimension."
116116
)
117117

118118
start_list = [0] * len(input.shape)
@@ -148,9 +148,9 @@ def circular_padNd(
148148

149149
rank = len(input.shape)
150150

151-
if len(pad) / 2 > rank:
151+
if len(pad) // 2 > rank:
152152
raise RuntimeError(
153-
f"Trying to pad last {len(pad) / 2} dimension but the input only has {rank} dimension."
153+
f"Trying to pad last {len(pad) // 2} dimension but the input only has {rank} dimension."
154154
)
155155

156156
start_list = [0] * len(input.shape)

0 commit comments

Comments
 (0)