Trait IntoDScalar

Source
pub trait IntoDScalar: LinalgScalar + PartialEq {
    const DTYPE: DType;

    // Required methods
    fn to_dscalar(&self) -> DScalar;
    fn from_dscalar(scalar: DScalar) -> Option<Self>;
    fn vec_to_dtensor(data: Vec<Self>) -> DTensor;
}

Required Associated Constants§

Required Methods§

Source

fn to_dscalar(&self) -> DScalar

Source

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

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

Source§

const DTYPE: DType = DType::F32

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for f64

Source§

const DTYPE: DType = DType::F64

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for i8

Source§

const DTYPE: DType = DType::I8

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for i16

Source§

const DTYPE: DType = DType::I16

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for i32

Source§

const DTYPE: DType = DType::I32

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for i64

Source§

const DTYPE: DType = DType::I64

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for u8

Source§

const DTYPE: DType = DType::U8

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for u16

Source§

const DTYPE: DType = DType::U16

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for u32

Source§

const DTYPE: DType = DType::U32

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Source§

impl IntoDScalar for u64

Source§

const DTYPE: DType = DType::U64

Source§

fn to_dscalar(&self) -> DScalar

Source§

fn from_dscalar(scalar: DScalar) -> Option<Self>

Source§

fn vec_to_dtensor(data: Vec<Self>) -> DTensor

Implementors§

Source§

impl IntoDScalar for DBool

Source§

const DTYPE: DType = DType::Bool