attribute_binder.h#
-
namespace ONNX_LIGHT_NAMESPACE
-
namespace internal
Typedefs
-
using AttributeMap = std::unordered_map<std::string, const AttributeProto*>#
Maps formal attribute names to concrete attribute values from a call-site node.
-
class AttributeBinder : public ONNX_LIGHT_NAMESPACE::internal::MutableVisitor#
- #include <attribute_binder.h>
Binds attribute references in a function body to call-site attribute values.
A bound attribute keeps the original attribute name from the callee function and copies only the value from the corresponding call-site attribute. If the call-site does not supply a value for a referenced attribute, the referenced attribute is removed.
Public Functions
-
inline explicit AttributeBinder(const AttributeMap &attr_map)#
Initializes the binder with a map of call-site attributes indexed by name.
-
inline virtual void VisitNode(NodeProto *node) override#
Updates attributes in a node and recursively updates attributes in subgraphs.
Binding a formal attribute parameter may remove an attribute from a node when the call-site omits that parameter. This requires processing at node scope (not at attribute scope) because attributes may be erased from the node list.
Public Static Functions
-
static inline void BindAttributes(const NodeProto &callnode, FunctionProto &callee)#
Binds all attribute references in a callee function using a call-site node.
- Parameters:
callnode – Node that provides concrete attribute values.
callee – Function body to update in place.
Private Members
-
const AttributeMap &attr_map_#
-
inline explicit AttributeBinder(const AttributeMap &attr_map)#
-
using AttributeMap = std::unordered_map<std::string, const AttributeProto*>#
-
namespace internal