@@ -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 )
@@ -51,7 +51,7 @@ def constant_padNd(
5151 shape = tuple (new_shape ),
5252 stride = tuple (stride_list ),
5353 )
54- value_const = get_trt_tensor (ctx . net , value , f"{ name } _value" , input .dtype )
54+ value_const = get_trt_tensor (ctx , value , f"{ name } _value" , input .dtype )
5555 layer .set_input (4 , value_const )
5656 layer .mode = trt .SliceMode .FILL
5757
@@ -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