internal_symbol.h#

Defines

FORALL_BUILTIN_SYMBOLS(_)#

Defines the builtin interned symbols used by ONNX graph rewriting code.

The macro expands to both enum values and string-mapping switch cases in internal_symbol.cc, keeping the canonical symbol list in one place.

DEFINE_SYMBOL(s)#
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.

Enums

enum BuiltinSymbol#

Values:

enumerator kLastSymbol#

Functions

static inline bool operator==(Symbol lhs, Symbol rhs)#
static inline bool operator==(BuiltinSymbol lhs, Symbol rhs)#
static inline bool operator==(Symbol lhs, BuiltinSymbol rhs)#
inline Symbol operator""_sym(const char *s, size_t)#

Creates a Symbol from a string literal, for example “axis”_sym.

struct Symbol#
#include <internal_symbol.h>

Represents a lightweight interned symbol identifier.

Builtin symbols map to BuiltinSymbol values. Non-builtin symbols are added on demand by a process-wide string interning table.

Public Functions

Symbol() = default#
inline Symbol(BuiltinSymbol value)#

Creates a symbol from a builtin symbol value.

explicit Symbol(const std::string &s)#

Creates a symbol by interning the corresponding string value.

inline explicit Symbol(uint32_t value)#

Creates a symbol from a raw symbol identifier.

inline operator uint32_t() const#

Returns the symbol identifier as an integer.

const char *toString() const#

Returns the string representation of this symbol.

Private Members

uint32_t value = {0}#
namespace std#
template<>
struct hash<onnx_light::Symbol>#

Public Functions

inline std::size_t operator()(onnx_light::Symbol s) const#

Hashes the numeric symbol identifier.