DeviceChangeAPI

Trait DeviceChangeAPI 

Source
pub trait DeviceChangeAPI<'l, BOut, R, T, D>
where Self: DeviceRawAPI<T>, BOut: DeviceRawAPI<T>, D: DimAPI, R: DataAPI<Data = Self::Raw>,
{ type Repr: DataAPI<Data = BOut::Raw>; type ReprTo: DataAPI<Data = BOut::Raw>; // Required methods fn change_device( tensor: TensorAny<R, T, Self, D>, device: &BOut, ) -> Result<TensorAny<Self::Repr, T, BOut, D>>; fn into_device( tensor: TensorAny<R, T, Self, D>, device: &BOut, ) -> Result<TensorAny<DataOwned<BOut::Raw>, T, BOut, D>>; fn to_device( tensor: &'l TensorAny<R, T, Self, D>, device: &BOut, ) -> Result<TensorAny<Self::ReprTo, T, BOut, D>>; }

Required Associated Types§

Source

type Repr: DataAPI<Data = BOut::Raw>

Source

type ReprTo: DataAPI<Data = BOut::Raw>

Required Methods§

Source

fn change_device( tensor: TensorAny<R, T, Self, D>, device: &BOut, ) -> Result<TensorAny<Self::Repr, T, BOut, D>>

Source

fn into_device( tensor: TensorAny<R, T, Self, D>, device: &BOut, ) -> Result<TensorAny<DataOwned<BOut::Raw>, T, BOut, D>>

Source

fn to_device( tensor: &'l TensorAny<R, T, Self, D>, device: &BOut, ) -> Result<TensorAny<Self::ReprTo, T, BOut, D>>

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.

Implementors§

Source§

impl<'a, R, T, D> DeviceChangeAPI<'a, DeviceCpuSerial, R, T, D> for DeviceCpuSerial
where T: Clone + Send + Sync + 'a, D: DimAPI, R: DataCloneAPI<Data = Vec<T>>,

Source§

type Repr = R

Source§

type ReprTo = DataRef<'a, Vec<T>>

Source§

impl<'a, R, T, D> DeviceChangeAPI<'a, DeviceCpuSerial, R, T, D> for DeviceFaer
where T: Clone + Send + Sync + 'a, D: DimAPI, R: DataCloneAPI<Data = Vec<T>>,

Source§

type Repr = R

Source§

type ReprTo = DataRef<'a, Vec<T>>

Source§

impl<'a, R, T, D> DeviceChangeAPI<'a, DeviceFaer, R, T, D> for DeviceCpuSerial
where T: Clone + Send + Sync + 'a, D: DimAPI, R: DataCloneAPI<Data = Vec<T>>,

Source§

type Repr = R

Source§

type ReprTo = DataRef<'a, Vec<T>>

Source§

impl<'a, R, T, D> DeviceChangeAPI<'a, DeviceFaer, R, T, D> for DeviceFaer
where T: Clone + Send + Sync + 'a, D: DimAPI, R: DataCloneAPI<Data = Vec<T>>,

Source§

type Repr = R

Source§

type ReprTo = DataRef<'a, Vec<T>>