pub enum SubgraphPattern {
Declarative(PatternTree),
Callable(fn(&Graph, NodeId) -> Option<PatternMatch>),
}Expand description
Canonical primitive-subgraph pattern that a fused op represents. Used by fusion rules.
Two reasonable shapes; the registry supports both:
Callable— a closure-style matcher, mirrors PR 3’scanonical_softmax_pattern. Maximally flexible (consumer-count guards, cross-checks); less analyzable.Declarative— a recursivePatternTreethat the rule engine compiles to a matcher. More analyzable; auto-generation from the registry entry is straightforward.
Step 3 ports SoftmaxLastDim’s existing matcher to Callable. The
declarative form (see Q1 in docs/fused-op-registry.md) is wired up
in step 4 once a second op exercises the abstraction.
Variants§
Declarative(PatternTree)
Callable(fn(&Graph, NodeId) -> Option<PatternMatch>)
Auto Trait Implementations§
impl Freeze for SubgraphPattern
impl RefUnwindSafe for SubgraphPattern
impl Send for SubgraphPattern
impl Sync for SubgraphPattern
impl Unpin for SubgraphPattern
impl UnsafeUnpin for SubgraphPattern
impl UnwindSafe for SubgraphPattern
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more