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_NAMESPACEso 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 withONNX_APIcompile without modification.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_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 fromonnx.Functions
-
static inline bool operator==(BuiltinSymbol lhs, Symbol rhs)#
-
static inline bool operator==(Symbol lhs, BuiltinSymbol rhs)#
-
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}#
-
Symbol() = default#
-
static inline bool operator==(BuiltinSymbol lhs, Symbol rhs)#
-
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.
-
inline std::size_t operator()(onnx_light::Symbol s) const#
-
template<>