Skip to main content

TensorKind

Trait TensorKind 

pub trait TensorKind:
    Sealed
    + Clone
    + Send
    + Sync
    + Debug {
    const KIND: Kind;

    // Provided method
    fn name() -> &'static str { ... }
}
Expand description

A type-level representation of the kind of a tensor. Metadata access is lazy.

§Notes

This trait is intentionally sealed to keep the set of tensor kinds closed.

Although exposed publicly, tensor kinds are not meant to be extensible: the backend dispatch system, DType, and all tensor ops assume a fixed, closed set of tensor kinds (e.g. Float, Int, Bool), each mapping directly to a corresponding backend implementation.

Required Associated Constants§

const KIND: Kind

The tensor kind identifier.

Provided Methods§

fn name() -> &'static str

The name of the tensor kind.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

§

impl TensorKind for Bool

§

const KIND: Kind = Kind::Bool

§

impl TensorKind for Float

§

const KIND: Kind = Kind::Float

§

impl TensorKind for Int

§

const KIND: Kind = Kind::Int