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§
sourcefn try_to_dtype<E2: Dtype>(&self) -> Result<Self::To<E2, D>, D::Err>where
D: Device<E2> + ToDtypeKernel<E1, E2>,
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