Trait Type

Source
pub trait Type:
    Clone
    + Copy
    + Debug
    + PartialEq
    + 'static {
    type Repr: ElemType<DType = Self>;

    // Required methods
    fn boxed_dtype() -> Box<dyn DType>;
    fn safetensor_dtype(&self) -> Dtype;

    // Provided methods
    fn zero() -> Self::Repr { ... }
    fn one() -> Self::Repr { ... }
    fn from_f64(val: f64) -> Option<Self::Repr> { ... }
    fn primitive_full_zero() -> Full<Self> { ... }
    fn primitive_full_one() -> Full<Self> { ... }
    fn primitive_rand() -> Random<Self> { ... }
    fn primitive_randn() -> Normal<Self> { ... }
    fn primitive_as_type(&self) -> ToDType<Self> { ... }
    fn size_of_elem() -> usize { ... }
}

Required Associated Types§

Source

type Repr: ElemType<DType = Self>

Required Methods§

Provided Methods§

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.

Implementors§