pub enum PatternNode {
Op {
op: OpTag,
operands: Vec<PatternNode>,
attrs: OpAttrs,
},
Bind {
index: u8,
},
SeeThrough {
then: Box<PatternNode>,
},
Any,
}Expand description
A node of the §3 declarative subgraph grammar. One type, two directions: a
region (Fuel -> synthesizer) populates Op { op, operands, attrs } +
Bind; an emitted pattern: (synthesizer -> Fuel) additionally carries
the consumer/extract routing the matcher compiler reads. SeeThrough/Any
are matcher-only and never appear in a concrete region.
Variants§
Op
An op over the OpTag vocabulary with one child per tensor input
(ordered, exact arity). attrs carries the scalar slot / load-bearing
attributes.
Bind
A leaf: bind the producing node as the fused op’s input[index]. A
repeated index is a node-identity guard on a shared input (§3.2);
indices across a region MUST equal [0, n_inputs).
SeeThrough
Match the inner node after skipping zero-or-more transparent wrappers (§3.3). Matcher-only.
Fields
then: Box<PatternNode>Any
Wildcard — matches any single node (§3.4). Matcher-only.
Implementations§
Source§impl PatternNode
impl PatternNode
Sourcepub fn bind_indices(&self) -> Vec<u8> ⓘ
pub fn bind_indices(&self) -> Vec<u8> ⓘ
Collect the distinct Bind indices in this tree (a region’s external
inputs). Used to validate bind indices form [0, n_inputs).
Trait Implementations§
Source§impl Clone for PatternNode
impl Clone for PatternNode
Source§fn clone(&self) -> PatternNode
fn clone(&self) -> PatternNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more