pattern_registry.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_NAMESPACEso 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_protouses hidden visibility by default.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.-
namespace core
-
namespace builder
Typedefs
-
using PatternFactory = std::function<std::unique_ptr<PatternOptimization>()>#
Factory creating one stateless graph-rewriting pattern.
Functions
-
void RegisterPattern(const std::string &name, PatternFactory factory, bool enabled_by_default = true)#
Registers a pattern factory under a stable diagnostic name.
Registration order determines the order returned by :cpp:func:
CreateRegisteredPatterns. Names must be non-empty and unique.enabled_by_default=falsemakes the pattern available only by explicit lookup.
-
std::vector<std::string> RegisteredPatternNames(bool include_opt_in = true)#
Returns names in registration order, optionally excluding explicit-only patterns.
-
void RegisterPatternSet(const std::string &name, const std::vector<std::string> &pattern_names)#
Registers a named set of pattern names.
Pattern names need not be registered yet, which allows Python-defined patterns to participate in sets. Set names must be non-empty and unique.
-
void ExtendPatternSet(const std::string &name, const std::vector<std::string> &pattern_names)#
Adds pattern names to an existing set or to the computed
allset.
-
bool UnregisterPatternSet(const std::string &name)#
Removes a custom set. Built-in sets and the computed
allset are retained.
-
std::vector<std::string> RegisteredPatternSetNames()#
Returns names of all registered sets, including the computed
allset.
-
std::map<std::string, std::vector<std::string>> RegisteredPatternSets()#
Returns all pattern sets, including
allas the union of registered names and set members.
-
std::vector<std::unique_ptr<PatternOptimization>> CreateRegisteredPatterns(std::optional<symbolic::Device> device = std::nullopt)#
Creates registered patterns, optionally filtering by target device.
Includes only patterns enabled by default. With a filter, includes device-independent patterns and those targeting that exact device. kUndefined selects only independent ones. Opt-in patterns remain available through CreateRegisteredPattern.
-
using PatternFactory = std::function<std::unique_ptr<PatternOptimization>()>#
-
namespace builder
-
namespace core