create_model_proto()

audonnx.testing.create_model_proto(shapes, *, dtype=1, opset_version=14, ir_version=7)[source]

Create test ONNX proto object.

Creates an identity graph with input and output nodes of the given shapes. For each entry an input and output node will be created. -1, None or strings define a dynamic axis. Per node, one dynamic axis is allowed. The identity graph can be used as path argument of audonnx.Model.

Parameters:
  • shapes (Sequence[Sequence[int]]) – list with shapes defining the identical input and output nodes of the model graph

  • dtype (int) – data type, see supported data types

  • opset_version (int) – opset version

  • ir_version (int) – ir version

Return type:

ModelProto

Returns:

ONNX object

Examples

>>> model = create_model_proto([[2]])
>>> print(onnx.printer.to_text(model))
<
   ir_version: 7,
   opset_import: ["" : 14],
   producer_name: "test"
>
test (float[2] "input-0") => (float[2] "output-0") {
   "output-0" = Identity ("input-0")
}