onnx_alias.h#

Defines backwards-compatible type aliases for ONNX protobuf enumerations.

The original protobuf-generated C++ code exposed flat names such as TensorProto_DataType. The onnx-light implementation uses scoped enumerations (e.g. TensorProto::DataType). The aliases defined here restore the flat names so that code written against the original protobuf headers continues to compile without modification.

Defines

TensorProto_DataType_Name#
ONNX_LIGHT_VERSION_ENUM_DEFINED
namespace onnx_light

Alias that makes onnx-light headers compatible with code that references ONNX_LIGHT_NAMESPACE (the macro used in the standard onnx package).

Set to ONNX_LIGHT_NAMESPACE so both names resolve to the same namespace.

Symbol-visibility attribute for the public onnx-light C++ API.

Defined as empty because onnx-light does not require explicit __declspec(dllexport) or __attribute__((visibility("default"))) annotations — visibility is controlled at the shared-library level. The macro is provided so that vendored ONNX headers that decorate their declarations with ONNX_API compile without modification.

Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal onnx namespace — rather than the ONNX_NAMESPACE macro — resolves to the onnx-light namespace. The standard onnx package lives in namespace onnx; onnx-light uses onnx_light (via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs from onnx.

Typedefs

using TensorProto_DataType = TensorProto::DataType#

Aliases TensorProto::DataType under the flat protobuf-style name.

Use TensorProto_DataType wherever the original protobuf-generated API expects the flat enumeration name. Fully-qualified values such as TensorProto_DataType::TensorProto_DataType_FLOAT are available through the TensorProto_DataType_* macros defined in onnx.h.

using TensorProto_DataLocation = TensorProto::DataLocation#
using TensorShapeProto_Dimension = TensorShapeProto::Dimension#
using AttributeProto_AttributeType = AttributeProto::AttributeType#
using TypeProto_Map = TypeProto::Map#
using TypeProto_Opaque = TypeProto::Opaque#
using TypeProto_Optional = TypeProto::Optional#
using TypeProto_Sequence = TypeProto::Sequence#
using TypeProto_SparseTensor = TypeProto::SparseTensor#
using TypeProto_Tensor = TypeProto::Tensor#

Enums

enum Version

Values:

enumerator START_VERSION
enumerator IR_VERSION_2017_10_10
enumerator IR_VERSION_2017_10_30
enumerator IR_VERSION_2017_11_3
enumerator IR_VERSION_2019_1_22
enumerator IR_VERSION_2019_3_18
enumerator IR_VERSION_2019_9_19
enumerator IR_VERSION_2020_5_8
enumerator IR_VERSION_2021_7_30
enumerator IR_VERSION_2023_5_5
enumerator IR_VERSION_2024_3_25
enumerator IR_VERSION_2025_05_12
enumerator IR_VERSION_2025_08_26
enumerator IR_VERSION
enumerator START_VERSION
enumerator IR_VERSION_2017_10_10
enumerator IR_VERSION_2017_10_30
enumerator IR_VERSION_2017_11_3
enumerator IR_VERSION_2019_1_22
enumerator IR_VERSION_2019_3_18
enumerator IR_VERSION_2019_9_19
enumerator IR_VERSION_2020_5_8
enumerator IR_VERSION_2021_7_30
enumerator IR_VERSION_2023_5_5
enumerator IR_VERSION_2024_3_25
enumerator IR_VERSION_2025_05_12
enumerator IR_VERSION_2025_08_26
enumerator IR_VERSION

Variables

constexpr TensorProto::DataType TensorProto_DataType_UNDEFINED = TensorProto::UNDEFINED#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT = TensorProto::FLOAT#
constexpr TensorProto::DataType TensorProto_DataType_UINT8 = TensorProto::UINT8#
constexpr TensorProto::DataType TensorProto_DataType_INT8 = TensorProto::INT8#
constexpr TensorProto::DataType TensorProto_DataType_UINT16 = TensorProto::UINT16#
constexpr TensorProto::DataType TensorProto_DataType_INT16 = TensorProto::INT16#
constexpr TensorProto::DataType TensorProto_DataType_INT32 = TensorProto::INT32#
constexpr TensorProto::DataType TensorProto_DataType_INT64 = TensorProto::INT64#
constexpr TensorProto::DataType TensorProto_DataType_STRING = TensorProto::STRING#
constexpr TensorProto::DataType TensorProto_DataType_BOOL = TensorProto::BOOL#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT16 = TensorProto::FLOAT16#
constexpr TensorProto::DataType TensorProto_DataType_DOUBLE = TensorProto::DOUBLE#
constexpr TensorProto::DataType TensorProto_DataType_UINT32 = TensorProto::UINT32#
constexpr TensorProto::DataType TensorProto_DataType_UINT64 = TensorProto::UINT64#
constexpr TensorProto::DataType TensorProto_DataType_COMPLEX64 = TensorProto::COMPLEX64#
constexpr TensorProto::DataType TensorProto_DataType_COMPLEX128 = TensorProto::COMPLEX128#
constexpr TensorProto::DataType TensorProto_DataType_BFLOAT16 = TensorProto::BFLOAT16#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT8E4M3FN = TensorProto::FLOAT8E4M3FN#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT8E4M3FNUZ = TensorProto::FLOAT8E4M3FNUZ#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT8E5M2 = TensorProto::FLOAT8E5M2#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT8E5M2FNUZ = TensorProto::FLOAT8E5M2FNUZ#
constexpr TensorProto::DataType TensorProto_DataType_UINT4 = TensorProto::UINT4#
constexpr TensorProto::DataType TensorProto_DataType_INT4 = TensorProto::INT4#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT4E2M1 = TensorProto::FLOAT4E2M1#
constexpr TensorProto::DataType TensorProto_DataType_FLOAT8E8M0 = TensorProto::FLOAT8E8M0#
constexpr TensorProto::DataType TensorProto_DataType_UINT2 = TensorProto::UINT2#
constexpr TensorProto::DataType TensorProto_DataType_INT2 = TensorProto::INT2#
constexpr int TensorProto_DataType_DataType_MIN = 0#
constexpr int TensorProto_DataType_DataType_MAX = 26#
constexpr int TensorProto_DataType_DataType_ARRAYSIZE = 27#
constexpr TensorProto::DataLocation TensorProto_DataLocation_DEFAULT = TensorProto::DEFAULT#
constexpr TensorProto::DataLocation TensorProto_DataLocation_EXTERNAL = TensorProto::EXTERNAL#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_UNDEFINED = AttributeProto::UNDEFINED#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_FLOAT = AttributeProto::FLOAT#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_INT = AttributeProto::INT#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_STRING = AttributeProto::STRING#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_TENSOR = AttributeProto::TENSOR#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_GRAPH = AttributeProto::GRAPH#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_SPARSE_TENSOR = AttributeProto::SPARSE_TENSOR#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_TYPE_PROTO = AttributeProto::TYPE_PROTO#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_FLOATS = AttributeProto::FLOATS#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_INTS = AttributeProto::INTS#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_STRINGS = AttributeProto::STRINGS#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_TENSORS = AttributeProto::TENSORS#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_GRAPHS = AttributeProto::GRAPHS#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_SPARSE_TENSORS = AttributeProto::SPARSE_TENSORS#
constexpr AttributeProto::AttributeType AttributeProto_AttributeType_TYPE_PROTOS = AttributeProto::TYPE_PROTOS#