pub struct Tensor {
pub dims: Vec<IoDim>,
}Expand description
N-dimensional tensor representation.
A tensor describes the shape and memory layout of FFT data. It consists of a vector of dimensions, each with its own size and strides.
Fields§
§dims: Vec<IoDim>The dimensions of the tensor.
Implementations§
Source§impl Tensor
impl Tensor
Sourcepub fn total_size(&self) -> usize
pub fn total_size(&self) -> usize
Get the total number of elements.
Sourcepub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
Check if all dimensions are contiguous.
Sourcepub fn is_inplace_compatible(&self) -> bool
pub fn is_inplace_compatible(&self) -> bool
Check if input and output have identical strides (in-place compatible).
Sourcepub fn split(&self, axis: usize) -> (Self, Self)
pub fn split(&self, axis: usize) -> (Self, Self)
Split the tensor at the given axis.
Returns (outer dimensions, inner dimensions).
Sourcepub fn push_front(&mut self, dim: IoDim)
pub fn push_front(&mut self, dim: IoDim)
Prepend a dimension.
Trait Implementations§
impl Eq for Tensor
impl StructuralPartialEq for Tensor
Auto Trait Implementations§
impl Freeze for Tensor
impl RefUnwindSafe for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl UnsafeUnpin for Tensor
impl UnwindSafe for Tensor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more