Skip to main content

IndexOutputElement

Trait IndexOutputElement 

Source
pub trait IndexOutputElement:
    DeviceRepr
    + Sealed
    + Copy
    + Default
    + 'static {
    const KIND: IndexOutputKind;
}
Expand description

Sealed marker trait for the output index dtype produced by arg-reduction kernels (argmax / argmin axis ops).

Phase 12.2 (Fuel team feedback): split out as a sibling of IndexElement (which marks input index dtypes accepted by indexing / embedding / segment kernels) so plans like crate::ArgReduceKind-driven ArgReducePlan can dispatch over the output dtype without affecting the input-index trait hierarchy.

Today’s members are u32, i32, and i64. PyTorch defaults to i64; CUB / NVIDIA libraries and some downstream frameworks (e.g. Fuel) prefer u32. The trait is sealed because new members require a matching FFI entry point in the *-kernels-sys crate.

Required Associated Constants§

Source

const KIND: IndexOutputKind

Runtime tag for this output index element type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IndexOutputElement for i32

Source§

const KIND: IndexOutputKind = IndexOutputKind::I32

Source§

impl IndexOutputElement for i64

Source§

const KIND: IndexOutputKind = IndexOutputKind::I64

Source§

impl IndexOutputElement for u32

Source§

const KIND: IndexOutputKind = IndexOutputKind::U32

Implementors§