OnnxAxisSpec

Structs ยท AiDotNet.Onnx

Per-axis shape descriptor for an ONNX TensorShapeProto.Dimension. Encodes either a concrete dim_value (e.g. channel count = 3) or a symbolic dim_param (e.g. "batch", "H", "W").

Inheritance: ValueType โ†’ OnnxAxisSpec

How It Works

Symbolic axes (issue #1211) let a single exported ONNX file run at any (batch, height, width) the downstream runtime feeds it. ONNX Runtime, OpenVINO and TensorRT all expect symbolic axes for production deployment; PyTorch surfaces them via torch.onnx.export(..., dynamic_axes=...).

Construct with the static Fixed or Symbolic factory methods.

Properties

Property Summary
int FixedDim { get; } Concrete dimension size when SymbolicName is null.
string SymbolicName { get; } Symbolic name (e.g.

Methods

Method Summary
OnnxAxisSpec Fixed(int dim) Concrete-size axis (encoded as ONNX dim_value).
OnnxAxisSpec Symbolic(string name) Symbolic axis (encoded as ONNX dim_param).