@@ -279,12 +279,15 @@ def squeeze_op(ctx, node, name, args):
279
279
del node .attr ["axis" ]
280
280
281
281
shape = ctx .get_shape (node .input [0 ])
282
- utils .make_sure (shape is not None , "squeeze input shape cannot be None" )
283
- shape_len = len (shape )
284
282
if axis and axis .ints :
285
283
axis = axis .ints
286
- axis = [a + shape_len if a < 0 else a for a in axis ]
284
+ neg_axis = any ([val < 0 for val in axis ])
285
+ if neg_axis :
286
+ utils .make_sure (shape is not None , "squeeze input shape cannot be None" )
287
+ shape_len = len (shape )
288
+ axis = [a + shape_len if a < 0 else a for a in axis ]
287
289
else :
290
+ utils .make_sure (shape is not None , "squeeze input shape cannot be None" )
288
291
axis = [i for i , j in enumerate (shape ) if j == 1 ]
289
292
node .set_attr ("axes" , axis )
290
293
@@ -460,7 +463,7 @@ def add_padding(ctx, node, kernel_shape, strides, dilations=None, spatial=2):
460
463
output_shape = spatial_map (output_shape , NHWC_TO_NCHW )
461
464
# calculate pads
462
465
if any (input_shape [i + 2 ] == - 1 for i in range (spatial )):
463
- log .warning ("node %s has unknown dim %s for pads calculation, fallback to auto_pad" % (
466
+ log .debug ("node %s has unknown dim %s for pads calculation, fallback to auto_pad" % (
464
467
node .name , str (input_shape )))
465
468
node .set_attr ("auto_pad" , "SAME_UPPER" )
466
469
else :
@@ -1217,7 +1220,6 @@ def minmax_op(ctx, node, name, args):
1217
1220
# get a tensor with zeros (since there is no Fill op as of opset8)
1218
1221
sub_node = ctx .make_node ("Sub" , [has_correct_shape , has_correct_shape ],
1219
1222
op_name_scope = input_node .name )
1220
-
1221
1223
# use add as 'broadcast' op
1222
1224
add_node = ctx .make_node ("Add" , [input_node .output [0 ], sub_node .output [0 ]],
1223
1225
op_name_scope = input_node .name )
0 commit comments