Trait tch::kind::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

Implementations on Foreign Types§

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 bf16

source§

const KIND: Kind = Kind::Half

source§

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

source§

impl Element for i64

source§

const KIND: Kind = Kind::Int64

source§

const ZERO: Self = 0i64

source§

impl Element for bool

source§

const KIND: Kind = Kind::Bool

source§

const ZERO: Self = false

source§

impl Element for i32

source§

const KIND: Kind = Kind::Int

source§

const ZERO: Self = 0i32

source§

impl Element for u8

source§

const KIND: Kind = Kind::Uint8

source§

const ZERO: Self = 0u8

source§

impl Element for f16

source§

const KIND: Kind = Kind::Half

source§

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

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

Implementors§