tml.h#

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.

Maps the upstream compatibility macro to onnx-light’s explicit proto ABI annotation. This keeps declarations from vendored ONNX headers visible when lib_onnx_proto uses hidden visibility by default.

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.

namespace proto#

Typedefs

using MapStringToString = MapMessage<std::string, std::string>#
using MapStringToInt64 = MapMessage<std::string, int64_t>#
using MapStringToFloat = MapMessage<std::string, float>#
using MapStringToDouble = MapMessage<std::string, double>#
using MapInt64ToString = MapMessage<int64_t, std::string>#
using MapInt64ToInt64 = MapMessage<int64_t, int64_t>#
using MapInt64ToFloat = MapMessage<int64_t, float>#
using MapInt64ToDouble = MapMessage<int64_t, double>#
using VectorMapStringToFloat = VectorMapMessage<MapStringToFloat>#
using VectorMapInt64ToFloat = VectorMapMessage<MapInt64ToFloat>#
template<typename K, typename V>
class MapMessage#
#include <tml.h>

Public Types

using MapType = std::map<K, V>#

Public Functions

inline const MapType &v() const#
inline MapType &v()#
inline void Clear()#
inline void ParseFromStream(ol::utils::BinaryStream &s, ol::ParseOptions&)#

Private Members

MapType v_#
class TraditionalMLData#
#include <tml.h>

Public Types

enum ValuesCase#

Values:

enumerator VALUES_NOT_SET#
enumerator kMapStringToString#
enumerator kMapStringToInt64#
enumerator kMapStringToFloat#
enumerator kMapStringToDouble#
enumerator kMapInt64ToString#
enumerator kMapInt64ToInt64#
enumerator kMapInt64ToFloat#
enumerator kMapInt64ToDouble#
enumerator kVectorString#
enumerator kVectorFloat#
enumerator kVectorInt64#
enumerator kVectorDouble#
enumerator kVectorMapStringToFloat#
enumerator kVectorMapInt64ToFloat#
enumerator kTensor#

Public Functions

inline ValuesCase values_case() const#
inline const MapStringToString &map_string_to_string() const#
inline const MapStringToInt64 &map_string_to_int64() const#
inline const MapStringToFloat &map_string_to_float() const#
inline const MapStringToDouble &map_string_to_double() const#
inline const MapInt64ToString &map_int64_to_string() const#
inline const MapInt64ToInt64 &map_int64_to_int64() const#
inline const MapInt64ToFloat &map_int64_to_float() const#
inline const MapInt64ToDouble &map_int64_to_double() const#
inline const VectorMapStringToFloat &vector_map_string_to_float() const#
inline const VectorMapInt64ToFloat &vector_map_int64_to_float() const#
inline const ONNX_NAMESPACE::TensorProto &tensor() const#
inline const std::string &name() const#
inline const std::string &debug_info() const#
inline void Clear()#
inline bool ParseFromArray(const void *data, int size)#
inline bool ParseFromStream(ol::utils::BinaryStream &s, ol::ParseOptions &opts)#

Private Functions

template<typename Msg>
inline void ParseSub(ol::utils::BinaryStream &s, ol::ParseOptions &opts, Msg &msg, ValuesCase c)#

Private Members

ValuesCase values_case_ = VALUES_NOT_SET#
MapStringToString map_string_to_string_#
MapStringToInt64 map_string_to_int64_#
MapStringToFloat map_string_to_float_#
MapStringToDouble map_string_to_double_#
MapInt64ToString map_int64_to_string_#
MapInt64ToInt64 map_int64_to_int64_#
MapInt64ToFloat map_int64_to_float_#
MapInt64ToDouble map_int64_to_double_#
VectorMapStringToFloat vector_map_string_to_float_#
VectorMapInt64ToFloat vector_map_int64_to_float_#
ONNX_NAMESPACE::TensorProto tensor_#
std::string name_#
std::string debug_info_#
template<typename MapMsg>
class VectorMapMessage#
#include <tml.h>

Public Types

using RepeatedType = std::vector<MapMsg>#

Public Functions

inline const RepeatedType &v() const#
inline RepeatedType &v()#
inline void Clear()#
inline void ParseFromStream(ol::utils::BinaryStream &s, ol::ParseOptions &opts)#

Private Members

RepeatedType v_#
namespace tml_detail#

Enums

enum WireType#

Values:

enumerator kWireVarint#
enumerator kWire64Bit#
enumerator kWireLengthDelimited#
enumerator kWire32Bit#

Functions

inline void SkipField(ol::utils::BinaryStream &s, uint64_t wire_type)#
template<typename T>
T ReadScalar(ol::utils::BinaryStream &s)#
template<>
inline std::string ReadScalar<std::string>(ol::utils::BinaryStream &s)#
template<>
inline int64_t ReadScalar<int64_t>(ol::utils::BinaryStream &s)#
template<>
inline float ReadScalar<float>(ol::utils::BinaryStream &s)#
template<>
inline double ReadScalar<double>(ol::utils::BinaryStream &s)#
template<typename K, typename V>
inline void ParseMapEntry(ol::utils::BinaryStream &s, std::map<K, V> &out)#