Trait rten_tensor::IntoStorage

source ·
pub trait IntoStorage {
    type Output: Storage;

    // Required method
    fn into_storage(self) -> Self::Output;
}
Expand description

Trait for converting owned and borrowed element containers (Vec<T>, slices) into their corresponding Storage type.

This is used by Tensor::from_data.

Required Associated Types§

Required Methods§

source

fn into_storage(self) -> Self::Output

Implementations on Foreign Types§

source§

impl<'a, T> IntoStorage for &'a [T]

§

type Output = ViewData<'a, T>

source§

fn into_storage(self) -> ViewData<'a, T>

source§

impl<'a, T> IntoStorage for &'a mut [T]

§

type Output = ViewMutData<'a, T>

source§

fn into_storage(self) -> ViewMutData<'a, T>

source§

impl<'a, T> IntoStorage for Cow<'a, [T]>
where [T]: ToOwned<Owned = Vec<T>>,

§

type Output = CowData<'a, T>

source§

fn into_storage(self) -> Self::Output

source§

impl<'a, T, const N: usize> IntoStorage for &'a [T; N]

§

type Output = ViewData<'a, T>

source§

fn into_storage(self) -> ViewData<'a, T>

Implementors§

source§

impl<T: Storage> IntoStorage for T

§

type Output = T