Trait dfdx::nn::ToDtype

source ·
pub trait ToDtype<E1: Dtype, D: Device<E1>>: TensorCollection<E1, D> {
    // Provided methods
    fn try_to_dtype<E2: Dtype>(&self) -> Result<Self::To<E2, D>, D::Err>
       where D: Device<E2> + ToDtypeKernel<E1, E2> { ... }
    fn to_dtype<E2: Dtype>(&self) -> Self::To<E2, D>
       where D: Device<E2> + ToDtypeKernel<E1, E2> { ... }
}
Expand description

Something that can be copied to have a different dtype

Provided Methods§

source

fn try_to_dtype<E2: Dtype>(&self) -> Result<Self::To<E2, D>, D::Err>where D: Device<E2> + ToDtypeKernel<E1, E2>,

Fallible version of ToDtype::to_dtype

source

fn to_dtype<E2: Dtype>(&self) -> Self::To<E2, D>where D: Device<E2> + ToDtypeKernel<E1, E2>,

Create a copy of self with dtype E2

Implementors§

source§

impl<E1: Dtype, D: Device<E1>, T: TensorCollection<E1, D>> ToDtype<E1, D> for T