Element

Trait Element 

Source
pub unsafe trait Element: Clone {
    const KIND: Kind;
    const ZERO: Self;
}
Expand description

Kinds for tensor elements

§Safety

The specified Kind must be for a type that has the same length as Self.

Required Associated Constants§

Source

const KIND: Kind

Source

const ZERO: Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Element for bool

Source§

const KIND: Kind = Kind::Bool

Source§

const ZERO: Self = false

Source§

impl Element for f32

Source§

const KIND: Kind = Kind::Float

Source§

const ZERO: Self = 0f32

Source§

impl Element for f64

Source§

const KIND: Kind = Kind::Double

Source§

const ZERO: Self = 0f64

Source§

impl Element for i8

Source§

const KIND: Kind = Kind::Int8

Source§

const ZERO: Self = 0i8

Source§

impl Element for i16

Source§

const KIND: Kind = Kind::Int16

Source§

const ZERO: Self = 0i16

Source§

impl Element for i32

Source§

const KIND: Kind = Kind::Int

Source§

const ZERO: Self = 0i32

Source§

impl Element for i64

Source§

const KIND: Kind = Kind::Int64

Source§

const ZERO: Self = 0i64

Source§

impl Element for u8

Source§

const KIND: Kind = Kind::Uint8

Source§

const ZERO: Self = 0u8

Source§

impl Element for bf16

Source§

const KIND: Kind = Kind::Half

Source§

const ZERO: Self = half::bf16::ZERO

Source§

impl Element for f16

Source§

const KIND: Kind = Kind::Half

Source§

const ZERO: Self = half::f16::ZERO

Implementors§