pub trait Emittable: Differentiable + PartialEq {
const ELEMENT: &'static str;
const ZERO: &'static str;
const NEGATIVE_INFINITY: &'static str;
const ACCUMULATION: Option<&'static str> = None;
// Required method
fn literal(&self) -> String;
}Expand description
An element type StableHLO emission can render: its MLIR type name and the literal forms MLIR’s float syntax accepts.
Finite values print in shortest-round-trip decimal (normalized to carry a dot, which MLIR requires); non-finite values print as IEEE bit-pattern hex, the only literal form MLIR has for them.
Required Associated Constants§
Sourceconst ZERO: &'static str
const ZERO: &'static str
The literal of the additive identity, seeding sum reduces and zero pads.
Sourceconst NEGATIVE_INFINITY: &'static str
const NEGATIVE_INFINITY: &'static str
The literal of negative infinity, seeding max reduces.
Provided Associated Constants§
Sourceconst ACCUMULATION: Option<&'static str> = None
const ACCUMULATION: Option<&'static str> = None
The MLIR element type accumulating operations compute in
before converting back, or None when they accumulate in the
element type itself.
It must name the element’s
Differentiable::Accumulator
whenever that type differs from the element: matmuls, sum
reductions, fold, and scatter then emit the wider result
type with an explicit convert back — the precision is IR
semantics, never an implementation’s private choice.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".