Shape-Changing IR Evaluation #
Local semantics for the shape-oriented IR nodes emitted by PyTorch/ONNX import paths. These facts pin the executable IR evaluator to the corresponding typed tensor operations.
Shape-changing unary operations with statically typed output tensors.
- reshape
(inShape outShape : Spec.Shape)
(hsize : inShape.size = outShape.size)
: ShapeOperation inShape outShape
Reshape between shapes with equal element counts.
- flatten
(s : Spec.Shape)
: ShapeOperation s (Spec.Shape.dim s.size Spec.Shape.scalar)
Flatten a tensor to one dimension.
- broadcastTo
(s₁ s₂ : Spec.Shape)
(witness : s₁.CanBroadcastTo s₂)
: ShapeOperation s₁ s₂
Broadcast to a compatible target shape.
- sum
(s : Spec.Shape)
: ShapeOperation s Spec.Shape.scalar
Sum every coordinate to a scalar.
Instances For
IR opcode represented by a typed shape operation.
Instances For
Typed denotation of a shape operation.
Instances For
Evaluate any typed shape operation in its canonical two-node graph.
Local IR semantics for reshape when the element counts match.
Local IR semantics for flatten.
Local IR semantics for broadcastTo when the shapes are broadcast compatible.
Local IR semantics for reduction to a scalar sum.