pub struct TensorView {
pub base_tensor_id: usize,
pub slices: Vec<SliceSpec>,
pub strides: Vec<isize>,
pub offset: usize,
}Expand description
Tensor view descriptor for zero-copy operations
Fields§
§base_tensor_id: usizeBase tensor identifier
slices: Vec<SliceSpec>Slice specification for each dimension
strides: Vec<isize>Strides for each dimension (for strided access)
offset: usizeOffset from the base tensor
Implementations§
Source§impl TensorView
impl TensorView
Sourcepub fn full(base_tensor_id: usize, rank: usize) -> Self
pub fn full(base_tensor_id: usize, rank: usize) -> Self
Create a full view of a tensor (no slicing)
Sourcepub fn with_strides(self, strides: Vec<isize>) -> Self
pub fn with_strides(self, strides: Vec<isize>) -> Self
Create a view with specific offset and strides
Sourcepub fn with_offset(self, offset: usize) -> Self
pub fn with_offset(self, offset: usize) -> Self
Create a view with specific offset
Sourcepub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
Check if this view represents a contiguous slice
Sourcepub fn is_full_view(&self) -> bool
pub fn is_full_view(&self) -> bool
Check if this view is a complete view (no slicing)
Sourcepub fn compose(&self, other: &TensorView) -> Result<TensorView, String>
pub fn compose(&self, other: &TensorView) -> Result<TensorView, String>
Compose two views (create a view of a view)
Trait Implementations§
Source§impl Clone for TensorView
impl Clone for TensorView
Source§fn clone(&self) -> TensorView
fn clone(&self) -> TensorView
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TensorView
impl Debug for TensorView
Source§impl PartialEq for TensorView
impl PartialEq for TensorView
impl Eq for TensorView
impl StructuralPartialEq for TensorView
Auto Trait Implementations§
impl Freeze for TensorView
impl RefUnwindSafe for TensorView
impl Send for TensorView
impl Sync for TensorView
impl Unpin for TensorView
impl UnwindSafe for TensorView
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