pub struct TensorViewOps;Expand description
Memory-efficient tensor operations using views
Implementations§
Source§impl TensorViewOps
impl TensorViewOps
Sourcepub fn transpose_zero_copy<T>(
tensor: &TensorView<T>,
axes: &[usize],
) -> Result<TensorView<T>>
pub fn transpose_zero_copy<T>( tensor: &TensorView<T>, axes: &[usize], ) -> Result<TensorView<T>>
Perform zero-copy transpose if possible
Sourcepub fn reshape_zero_copy<T>(
tensor: &TensorView<T>,
new_shape: &[usize],
) -> Result<TensorView<T>>
pub fn reshape_zero_copy<T>( tensor: &TensorView<T>, new_shape: &[usize], ) -> Result<TensorView<T>>
Perform zero-copy reshape if possible
Sourcepub fn slice_zero_copy<T>(
tensor: &TensorView<T>,
ranges: &[(usize, usize)],
) -> Result<TensorView<T>>
pub fn slice_zero_copy<T>( tensor: &TensorView<T>, ranges: &[(usize, usize)], ) -> Result<TensorView<T>>
Create a zero-copy slice view
Check if two tensor views share memory
Sourcepub fn memory_stats<T>(tensor: &TensorView<T>) -> MemoryStats
pub fn memory_stats<T>(tensor: &TensorView<T>) -> MemoryStats
Get memory usage statistics for a tensor view
Sourcepub fn has_memory_aliases<T>(tensor: &TensorView<T>) -> bool
pub fn has_memory_aliases<T>(tensor: &TensorView<T>) -> bool
Check if a tensor view has memory aliases
Returns true if the tensor’s memory region overlaps with any other tracked tensors. This helps detect potentially unsafe operations on aliased memory.
Auto Trait Implementations§
impl Freeze for TensorViewOps
impl RefUnwindSafe for TensorViewOps
impl Send for TensorViewOps
impl Sync for TensorViewOps
impl Unpin for TensorViewOps
impl UnsafeUnpin for TensorViewOps
impl UnwindSafe for TensorViewOps
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> 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