create_model_proto()

audonnx.testing.create_model_proto(shapes, *, dtype=1, opset_version=14)[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
Return type

ModelProto

Returns

ONNX object

Examples

>>> create_model_proto([[2]])
ir_version: 9
opset_import {
  version: 14
}
producer_name: "test"
graph {
  node {
    input: "input-0"
    output: "output-0"
    op_type: "Identity"
  }
  name: "test"
  input {
    name: "input-0"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 2
          }
        }
      }
    }
  }
  output {
    name: "output-0"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 2
          }
        }
      }
    }
  }
}