proto_util.h#
Utilities for building canonical string identifiers for ONNX functions and
callee nodes, including onnx_light::FunctionImplId,
onnx_light::GetFunctionImplId(), and onnx_light::GetCalleeId().
Utilities for building canonical string identifiers for ONNX functions and callee nodes.
-
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.Typedefs
Functions
-
inline FunctionImplId GetFunctionImplId(const std::string &domain, const std::string &op, const std::string &overload)#
Builds a canonical function-implementation identifier.
Concatenates the normalized domain, op name, and (when non-empty) overload into a “::” separated string. The resulting value can be used as a stable key in function-implementation maps.
- Parameters:
domain – ONNX operator domain (e.g.
""or"ai.onnx.ml").op – Operator type name.
overload – Optional overload qualifier; omitted from the key when empty.
- Returns:
A string of the form
"domain::op"or"domain::op::overload".
-
inline FunctionImplId GetFunctionImplId(const FunctionProto &function)#
Builds a canonical function-implementation identifier from a FunctionProto.
Convenience overload that extracts the domain, name, and overload fields from
functionand delegates to the primary overload.- Parameters:
function – FunctionProto whose
domain,name, andoverloadfields are used to construct the identifier.- Returns:
A string of the form
"domain::name"or"domain::name::overload".
-
inline FunctionImplId GetCalleeId(const NodeProto &node)#
Builds the callee identifier for a NodeProto.
Constructs the identifier that matches the
FunctionImplIdof the function called bynode, using the node’s domain, op-type, and overload fields.- Parameters:
node – NodeProto whose
domain,op_type, andoverloadfields identify the called function.- Returns:
A string of the form
"domain::op_type"or"domain::op_type::overload".
-
inline FunctionImplId GetFunctionImplId(const std::string &domain, const std::string &op, const std::string &overload)#