Skip to main content

Element

Trait Element 

Source
pub trait Element:
    ToElement
    + ElementRandom
    + ElementConversion
    + ElementEq
    + ElementLimits
    + CheckedBitPattern
    + NoUninit
    + Zeroable
    + Debug
    + Display
    + Default
    + Send
    + Sync
    + Copy
    + 'static {
    // Required method
    fn dtype() -> DType;
}
Expand description

Core element trait for tensor values.

This trait defines the minimal set of capabilities required for a type to be stored and manipulated as a tensor element across all backends.

Required Methods§

Source

fn dtype() -> DType

The dtype of the element.

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§

impl Element for f32

Source§

impl Element for f64

Source§

impl Element for i8

Source§

impl Element for i16

Source§

impl Element for i32

Source§

impl Element for i64

Source§

impl Element for u8

Source§

impl Element for u16

Source§

impl Element for u32

Source§

impl Element for u64

Implementors§