Skip to main content

IndexElement

Trait IndexElement 

Source
pub trait IndexElement:
    DeviceRepr
    + Sealed
    + Copy
    + 'static {
    const KIND: IndexElementKind;
}
Expand description

Sealed marker trait for index-element types accepted by the indexing / embedding / segment kernel families.

Phase 11.5 (Fuel team feedback #7): split out as a sibling of Element so plans like [crate::indexing::GatherPlan] / [crate::embedding::EmbeddingPlan] / [crate::segment::SegmentSumPlan] can dispatch over the index dtype without coupling the value-dtype trait hierarchy. Today’s members are i32 (legacy) and i64 (PyTorch default). Sealed because new members require a matching FFI entry point in the *-kernels-sys crate.

Required Associated Constants§

Source

const KIND: IndexElementKind

Runtime tag for this 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 IndexElement for i32

Source§

const KIND: IndexElementKind = IndexElementKind::I32

Source§

impl IndexElement for i64

Source§

const KIND: IndexElementKind = IndexElementKind::I64

Implementors§