Elementwise IR Evaluation #
These lemmas cover the common elementwise operators emitted by the PyTorch and ONNX bridges. Each
statement is local to one IR node: if the parent values are already present in the evaluator table,
Graph.evalAt returns the corresponding spec tensor operation.
Same-shape binary elementwise operations supported by the local evaluator theorem.
- add : BinaryElementwiseOp
Elementwise addition.
- sub : BinaryElementwiseOp
Elementwise subtraction.
- mul : BinaryElementwiseOp
Elementwise multiplication.
- max : BinaryElementwiseOp
Elementwise maximum.
- min : BinaryElementwiseOp
Elementwise minimum.
Instances For
Translate a binary elementwise operation to its IR opcode.
Instances For
Denotation of a same-shape binary elementwise operation.
Instances For
Evaluate any supported same-shape binary elementwise node.
Same-shape unary elementwise operations without additional runtime side conditions.
- abs : UnaryElementwiseOp
Elementwise absolute value.
- sqrt : UnaryElementwiseOp
Elementwise square root.
- inv : UnaryElementwiseOp
Elementwise reciprocal.
- relu : UnaryElementwiseOp
Rectified linear unit.
- tanh : UnaryElementwiseOp
Hyperbolic tangent.
- sigmoid : UnaryElementwiseOp
Logistic sigmoid.
- softplus : UnaryElementwiseOp
Stable softplus.
- exp : UnaryElementwiseOp
Elementwise exponential.
- sin : UnaryElementwiseOp
Elementwise sine.
- cos : UnaryElementwiseOp
Elementwise cosine.
Instances For
Translate a unary elementwise operation to its IR opcode.
Instances For
Denotation of a same-shape unary elementwise operation.
Instances For
Evaluate any supported same-shape unary elementwise node.
Evaluate a binary elementwise node in an arbitrary graph from the lowering pass's shape invariant.
Evaluate a unary elementwise node in an arbitrary graph from the lowering pass's shape invariant.
Local IR semantics for elementwise addition.
Local IR semantics for elementwise subtraction.
Local IR semantics for elementwise multiplication.
Local IR semantics for elementwise maximum.
Local IR semantics for elementwise minimum.
Local IR semantics for elementwise absolute value.
Local IR semantics for elementwise square root.
Local IR semantics for elementwise reciprocal.
Local IR semantics for ReLU.
Local IR semantics for tanh.
Local IR semantics for sigmoid.
Local IR semantics for softplus.
The scalar epsilon parent is read in the same context as the input tensor.
In particular, this equality also preserves an epsilon tangent when the context is a dual number type. The IR node uses the source operation's total logarithm semantics; checking a positive logarithm interval belongs to certificate construction.
Local IR semantics for exp.
Local IR semantics for sin.
Local IR semantics for cos.
Local IR semantics for log on inputs satisfying the IR positivity side condition.