@@ -695,7 +695,13 @@ def _convert_since_9(cls, ctx, node, op_type, use_target_size=False):
695
695
final_target_size = build_dynamic_target_size (ctx , input_nchw , node .inputs [1 ])
696
696
roi = ctx .make_const (utils .make_name ("roi" ), np .array ([]).astype (np .float32 ))
697
697
const_empty_float = ctx .make_const (utils .make_name ("const_empty_float" ), np .array ([], dtype = np .float32 ))
698
- upsample = ctx .make_node ("Resize" , [input_nchw .output [0 ], roi .output [0 ], const_empty_float .output [0 ], final_target_size .output [0 ]],
698
+ resize_inputs = [
699
+ input_nchw .output [0 ],
700
+ roi .output [0 ],
701
+ const_empty_float .output [0 ],
702
+ final_target_size .output [0 ]
703
+ ]
704
+ upsample = ctx .make_node ("Resize" , resize_inputs ,
699
705
attr = {"mode" : mode , "nearest_mode" : "floor" ,
700
706
"coordinate_transformation_mode" : "asymmetric" })
701
707
else :
@@ -707,7 +713,8 @@ def _convert_since_9(cls, ctx, node, op_type, use_target_size=False):
707
713
n , h , w , c = shape
708
714
nh , nw = target_shape
709
715
# scales is nchw
710
- # the reason not storing data at raw field is because of the bug: https://github.com/onnx/onnx/issues/1852
716
+ # the reason not storing data at raw field is because of the bug:
717
+ # https://github.com/onnx/onnx/issues/1852
711
718
scale_val = np .array ([1.0 , 1.0 , float (nh ) / h , float (nw ) / w ]).astype (np .float32 )
712
719
scales = ctx .make_const (utils .make_name ("scales" ), scale_val , raw = False )
713
720
else :
0 commit comments