Skip to main content

Element

Trait Element 

Source
pub trait Element:
    Sealed
    + Num
    + Clone
    + Debug
    + Send
    + Sync
    + 'static {
    const DTYPE: DType;
}
Expand description

An element type a Tensor<T> lens may be opened for.

Sealed: the eleven variants of [TensorDyn] are the only element types a tensor can carry, and a downstream impl would let as_typed name a dtype no tensor can hold.

Required Associated Constants§

Source

const DTYPE: DType

The runtime dtype this element type corresponds to.

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 Element for f32

Source§

const DTYPE: DType = DType::F32

Source§

impl Element for f64

Source§

const DTYPE: DType = DType::F64

Source§

impl Element for i8

Source§

const DTYPE: DType = DType::I8

Source§

impl Element for i16

Source§

const DTYPE: DType = DType::I16

Source§

impl Element for i32

Source§

const DTYPE: DType = DType::I32

Source§

impl Element for i64

Source§

const DTYPE: DType = DType::I64

Source§

impl Element for u8

Source§

const DTYPE: DType = DType::U8

Source§

impl Element for u16

Source§

const DTYPE: DType = DType::U16

Source§

impl Element for u32

Source§

const DTYPE: DType = DType::U32

Source§

impl Element for u64

Source§

const DTYPE: DType = DType::U64

Implementors§

Source§

impl Element for f16

Source§

const DTYPE: DType = DType::F16