Skip to content

Commit 88d9df5

Browse files
committed
Remove build model from quant model zoo
Signed-off-by: gcunhase <[email protected]>
1 parent 49d9c65 commit 88d9df5

File tree

1 file changed

+0
-59
lines changed

1 file changed

+0
-59
lines changed

tests/_test_utils/onnx_quantization/lib_test_models.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)