@@ -75,15 +75,15 @@ def create_onnx_model_with_custom_attributes():
7575 attribute_i32 = np .int32 (10 ),
7676 attribute_i64 = np .int64 (10 ),
7777 attribute_str = "string" ,
78- attribute_f32 = np . float (10 ),
78+ attribute_f32 = float (10 ),
7979 attribute_f64 = np .float64 (10 ),
80- attribute_bool = np . bool ( True ) ,
80+ attribute_bool = True ,
8181 attribute_type = onnx .TensorProto .INT32 ,
8282
8383 attribute_list_i32 = np .array ([1 , 2 , 3 ], dtype = np .int32 ),
8484 attribute_list_i64 = np .array ([1 , 2 , 3 ], dtype = np .int64 ),
85- attribute_list_str = np .array (["a" , "b" , "c" ], dtype = np . str ),
86- attribute_list_f32 = np .array ([1 , 2 , 3 ], dtype = np . float ),
85+ attribute_list_str = np .array (["a" , "b" , "c" ], dtype = str ),
86+ attribute_list_f32 = np .array ([1 , 2 , 3 ], dtype = float ),
8787 attribute_list_f64 = np .array ([1 , 2 , 3 ], dtype = np .float64 ),
8888 attribute_list_bool = [True , False , True ],
8989 attribute_list_type = np .array ([onnx .TensorProto .INT32 ,
@@ -340,15 +340,15 @@ def check_attribute(context, name, default_value):
340340 check_attribute (node , "attribute_str" , "abc" )
341341 check_attribute (node , "attribute_f32" , np .float32 (5 ))
342342 check_attribute (node , "attribute_f64" , np .float64 (5 ))
343- check_attribute (node , "attribute_bool" , np . bool ( False ) )
343+ check_attribute (node , "attribute_bool" , False )
344344 check_attribute (node , "attribute_type" , onnx .TensorProto .FLOAT )
345345
346346 check_attribute (node , "attribute_list_i32" , np .array ([4 , 5 , 6 ], dtype = np .int32 ))
347347 check_attribute (node , "attribute_list_i64" , np .array ([4 , 5 , 6 ], dtype = np .int64 ))
348- check_attribute (node , "attribute_list_str" , np .array (["d" , "e" , "f" ], dtype = np . str ))
349- check_attribute (node , "attribute_list_f32" , np .array ([4 , 5 , 6 ], dtype = np . float ))
348+ check_attribute (node , "attribute_list_str" , np .array (["d" , "e" , "f" ], dtype = str ))
349+ check_attribute (node , "attribute_list_f32" , np .array ([4 , 5 , 6 ], dtype = float ))
350350 check_attribute (node , "attribute_list_f64" , np .array ([4 , 5 , 6 ], dtype = np .float64 ))
351- check_attribute (node , "attribute_list_bool" , np .array ([True , False , True ], dtype = np . bool ))
351+ check_attribute (node , "attribute_list_bool" , np .array ([True , False , True ], dtype = bool ))
352352 check_attribute (node , "attribute_list_type" , np .array ([onnx .TensorProto .INT32 ,
353353 onnx .TensorProto .FLOAT ]))
354354
@@ -395,15 +395,15 @@ def check_attribute(context, name, expected_value, dtype):
395395
396396 check_attribute (node , "attribute_i32" , 10 , float )
397397 check_attribute (node , "attribute_i64" , 10 , float )
398- check_attribute (node , "attribute_str" , "string" , np . str )
398+ check_attribute (node , "attribute_str" , "string" , str )
399399 check_attribute (node , "attribute_f32" , 10 , int )
400400 check_attribute (node , "attribute_f64" , 10 , int )
401401 check_attribute (node , "attribute_bool" , True , bool )
402402 check_attribute (node , "attribute_type" , Type .i32 , Type )
403403
404404 check_attribute (node , "attribute_list_i32" , [1. , 2. , 3. ], float )
405405 check_attribute (node , "attribute_list_i64" , [1. , 2. , 3. ], float )
406- check_attribute (node , "attribute_list_str" , ["a" , "b" , "c" ], np . str )
406+ check_attribute (node , "attribute_list_str" , ["a" , "b" , "c" ], str )
407407 check_attribute (node , "attribute_list_f32" , [1 , 2 , 3 ], int )
408408 check_attribute (node , "attribute_list_f64" , [1 , 2 , 3 ], int )
409409 check_attribute (node , "attribute_list_bool" , [True , False , True ], bool )
0 commit comments