@@ -555,62 +555,3 @@ def build_convtranspose_conv_residual_model():
555555 onnx .checker .check_model (model_inferred )
556556
557557 return model_inferred
558-
559-
560- def build_matmul_relu_model (ir_version = 12 ):
561- # Define your model inputs and outputs
562- input_names = ["input_0" ]
563- output_names = ["output_0" ]
564- input_shapes = [(1 , 1024 , 1024 )]
565- output_shapes = [(1 , 1024 , 16 )]
566-
567- inputs = [
568- helper .make_tensor_value_info (input_name , onnx .TensorProto .FLOAT , input_shape )
569- for input_name , input_shape in zip (input_names , input_shapes )
570- ]
571- outputs = [
572- helper .make_tensor_value_info (output_name , onnx .TensorProto .FLOAT , output_shape )
573- for output_name , output_shape in zip (output_names , output_shapes )
574- ]
575-
576- # Create the ONNX graph with the nodes
577- nodes = [
578- helper .make_node (
579- op_type = "MatMul" ,
580- inputs = ["input_0" , "weights_1" ],
581- outputs = ["matmul1_matmul/MatMul:0" ],
582- name = "matmul1_matmul/MatMul" ,
583- ),
584- helper .make_node (
585- op_type = "Relu" ,
586- inputs = ["matmul1_matmul/MatMul:0" ],
587- outputs = ["output_0" ],
588- name = "relu1_relu/Relu" ,
589- ),
590- ]
591-
592- # Create the ONNX initializers
593- initializers = [
594- helper .make_tensor (
595- name = "weights_1" ,
596- data_type = onnx .TensorProto .FLOAT ,
597- dims = (1024 , 16 ),
598- vals = np .random .uniform (low = 0.5 , high = 1.0 , size = 1024 * 16 ),
599- ),
600- ]
601-
602- # Create the ONNX graph with the nodes and initializers
603- graph = helper .make_graph (
604- nodes , f"matmul_relu_ir_{ ir_version } " , inputs , outputs , initializer = initializers
605- )
606-
607- # Create the ONNX model
608- model = helper .make_model (graph )
609- model .opset_import [0 ].version = 13
610- model .ir_version = ir_version
611-
612- # Check the ONNX model
613- model_inferred = onnx .shape_inference .infer_shapes (model )
614- onnx .checker .check_model (model_inferred )
615-
616- return model_inferred
0 commit comments