Trait dfdx::nn::ToDevice

source ·
pub trait ToDevice<E: Dtype, D1: Device<E>, D2: Device<E>>: TensorCollection<E, D1> {
    // Provided methods
    fn try_to_device(&self, device: &D2) -> Result<Self::To<E, D2>, D2::Err> { ... }
    fn to_device(&self, device: &D2) -> Self::To<E, D2> { ... }
}
Expand description

Something that can be copied to another Device.

Provided Methods§

source

fn try_to_device(&self, device: &D2) -> Result<Self::To<E, D2>, D2::Err>

Fallible version of ToDevice::to_device

source

fn to_device(&self, device: &D2) -> Self::To<E, D2>

Copy self from D1 to D2

Implementors§

source§

impl<E: Dtype, D1: Device<E>, D2: Device<E>, T> ToDevice<E, D1, D2> for Twhere T: TensorCollection<E, D1>,