Skip to main content

Tensor4D

Struct Tensor4D 

Source
pub struct Tensor4D<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> { /* private fields */ }
Expand description

Four-dimensional tensor backed by an owned, aligned, fixed-size nested array.

Implementations§

Source§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> Tensor4D<T, D1, D2, D3, D4>

Source

pub const SHAPE: Shape

Source

pub const LEN: usize

Source

pub const fn new(value: T) -> Self
where T: Copy,

Source

pub const fn from_array(storage: TensorArray<T, D1, D2, D3, D4>) -> Self

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn as_slice_mut(&mut self) -> &mut [T]

Source

pub fn as_ptr(&self) -> *const T

Source

pub fn as_mut_ptr(&mut self) -> *mut T

Source

pub fn byte_len(&self) -> usize

Source

pub const fn len(&self) -> usize

Source

pub const fn is_empty(&self) -> bool

Source

pub const fn dim(&self) -> Shape

Source

pub fn fill(&mut self, value: T)
where T: Clone,

Auto Trait Implementations§

§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> Freeze for Tensor4D<T, D1, D2, D3, D4>
where Aligned<A64, [[[[T; D4]; D3]; D2]; D1]>: Freeze,

§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> RefUnwindSafe for Tensor4D<T, D1, D2, D3, D4>
where Aligned<A64, [[[[T; D4]; D3]; D2]; D1]>: RefUnwindSafe,

§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> Send for Tensor4D<T, D1, D2, D3, D4>
where Aligned<A64, [[[[T; D4]; D3]; D2]; D1]>: Send,

§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> Sync for Tensor4D<T, D1, D2, D3, D4>
where Aligned<A64, [[[[T; D4]; D3]; D2]; D1]>: Sync,

§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> Unpin for Tensor4D<T, D1, D2, D3, D4>
where Aligned<A64, [[[[T; D4]; D3]; D2]; D1]>: Unpin,

§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> UnsafeUnpin for Tensor4D<T, D1, D2, D3, D4>
where Aligned<A64, [[[[T; D4]; D3]; D2]; D1]>: UnsafeUnpin,

§

impl<T, const D1: usize, const D2: usize, const D3: usize, const D4: usize> UnwindSafe for Tensor4D<T, D1, D2, D3, D4>
where Aligned<A64, [[[[T; D4]; D3]; D2]; D1]>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.