Trait TensorLike

Source
pub trait TensorLike
where Self: Sized,
{ // Required methods fn f_to_device(&self, device: Device) -> Result<Self, TchError>; fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>; fn shallow_clone(&self) -> Self; // Provided methods fn to_device(&self, device: Device) -> Self { ... } fn to_kind(&self, kind: Kind) -> Self { ... } }

Required Methods§

Source

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source

fn shallow_clone(&self) -> Self

Provided Methods§

Source

fn to_device(&self, device: Device) -> Self

Source

fn to_kind(&self, kind: Kind) -> Self

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.

Implementations on Foreign Types§

Source§

impl TensorLike for bool

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for f32

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for f64

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for i8

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for i16

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for i32

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for i64

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for i128

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for isize

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for u8

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for u16

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for u32

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for u64

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for u128

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for usize

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl TensorLike for Tensor

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<K, T> TensorLike for BTreeMap<K, T>
where K: Ord + Clone, T: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<K, T> TensorLike for HashMap<K, T>
where K: Eq + Hash + Clone, T: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T1> TensorLike for (T1,)
where T1: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T1, T2> TensorLike for (T1, T2)
where T1: TensorLike, T2: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T1, T2, T3> TensorLike for (T1, T2, T3)
where T1: TensorLike, T2: TensorLike, T3: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T1, T2, T3, T4> TensorLike for (T1, T2, T3, T4)
where T1: TensorLike, T2: TensorLike, T3: TensorLike, T4: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T1, T2, T3, T4, T5> TensorLike for (T1, T2, T3, T4, T5)
where T1: TensorLike, T2: TensorLike, T3: TensorLike, T4: TensorLike, T5: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T> TensorLike for Option<T>
where T: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T> TensorLike for *const T

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T> TensorLike for *mut T

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T> TensorLike for &T

Source§

fn f_to_device(&self, _device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, _kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T> TensorLike for LinkedList<T>
where T: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T> TensorLike for VecDeque<T>
where T: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Source§

impl<T> TensorLike for Vec<T>
where T: TensorLike,

Source§

fn f_to_device(&self, device: Device) -> Result<Self, TchError>

Source§

fn f_to_kind(&self, kind: Kind) -> Result<Self, TchError>

Source§

fn shallow_clone(&self) -> Self

Implementors§