Expand description
Named TypeRelation slice constants for the common op shapes.
Sharing one set of canonical slices across bb-ops::backends,
bb-derive, and any third-party crate keeps op declarations
one-liners and lets the TypeSolver work with stable
pointer-equal constraint pools (the solver indexes relations by
their &'static address). New shapes graft in alongside these
without breaking the convention.
Statics§
- BROADCAST_
BINARY - Binary broadcast arithmetic:
Add,Sub,Mul,Div,Pow. Inputs + output share element type AND the output’s shape is the broadcast of the two inputs. - ELEMENTWISE
- Unary element-wise:
output.TypeNode == input.TypeNode. Shape preserved, element type preserved. Use forNeg,Abs,Sqrt,Exp,Log,Identity,Relu,Sigmoid,Tanh,Softmax,LeakyRelu,Gelu,GlobalAveragePool. - MATMUL_
BINARY MatMul/Dot— both inputs and the output share an element type; shape is matmul-specific and stays unconstrained until aCustomshape relation lands.- NO_
RELATIONS []— explicit “no constraint” slot. Use this on ops whose type is attribute-driven (Cast), variadic (Concat,Split,Gemm), structural (Reshape’s output shape comes from an attribute), or whose I/O types are heterogeneous and lack a shared element-type bound (most role placeholders).- REDUCE_
AXIS ReduceSum/ReduceMean/ReduceMax/ReduceMin— same element type, reduced shape driven byaxes/keepdimsattributes.- UNARY_
SAME_ ELEMENT input[0].ElementType == output[0].ElementTypewithout constraining shape. Use for ops that preserve element type but reshape (Reshape,Transpose,Slice,Squeeze,Unsqueeze).