Trait dfdx::tensor::NumpyDtype

source ·
pub trait NumpyDtype: Sized {
    const NUMPY_DTYPE_STR: &'static str;

    // Required methods
    fn read_endian<R: Read>(r: &mut R, endian: Endian) -> Result<Self>;
    fn write_endian<W: Write>(&self, w: &mut W, endian: Endian) -> Result<()>;
}
Expand description

Represents the NumpyDtype as a const str value.

Values should match up to the numpy documentation for dtypes.

For example an f32’s dtype is “f4”.

Required Associated Constants§

source

const NUMPY_DTYPE_STR: &'static str

Required Methods§

source

fn read_endian<R: Read>(r: &mut R, endian: Endian) -> Result<Self>

source

fn write_endian<W: Write>(&self, w: &mut W, endian: Endian) -> Result<()>

Implementations on Foreign Types§

source§

impl NumpyDtype for f64

source§

const NUMPY_DTYPE_STR: &'static str = "f8"

source§

fn read_endian<R: Read>(r: &mut R, endian: Endian) -> Result<Self>

source§

fn write_endian<W: Write>(&self, w: &mut W, endian: Endian) -> Result<()>

source§

impl NumpyDtype for f32

source§

const NUMPY_DTYPE_STR: &'static str = "f4"

source§

fn read_endian<R: Read>(r: &mut R, endian: Endian) -> Result<Self>

source§

fn write_endian<W: Write>(&self, w: &mut W, endian: Endian) -> Result<()>

Implementors§