pub struct TensorIterElement {
pub indices: ArrayUsize8,
pub offset: usize,
}Expand description
Thread-safe element reference for parallel iteration
Fields§
§indices: ArrayUsize8Indices of the element
offset: usizeOffset in bytes from the tensor’s base pointer
Implementations§
Source§impl TensorIterElement
impl TensorIterElement
Sourcepub unsafe fn as_ptr(&self, base_ptr: *const u8) -> *const u8
pub unsafe fn as_ptr(&self, base_ptr: *const u8) -> *const u8
Get a pointer to the element data given the tensor’s base pointer
§Safety
The caller must ensure that:
- The base_ptr is valid and points to the tensor’s data
- The offset is within the tensor’s bounds
- The returned pointer is used safely
Sourcepub unsafe fn as_mut_ptr(&self, base_ptr: *mut u8) -> *mut u8
pub unsafe fn as_mut_ptr(&self, base_ptr: *mut u8) -> *mut u8
Get a mutable pointer to the element data given the tensor’s base pointer
§Safety
The caller must ensure that:
- The base_ptr is valid and points to the tensor’s data
- The offset is within the tensor’s bounds
- The returned pointer is used safely
- No other references to this data exist
Trait Implementations§
Source§impl Clone for TensorIterElement
impl Clone for TensorIterElement
Source§fn clone(&self) -> TensorIterElement
fn clone(&self) -> TensorIterElement
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 moreimpl Copy for TensorIterElement
impl Send for TensorIterElement
impl Sync for TensorIterElement
Auto Trait Implementations§
impl Freeze for TensorIterElement
impl RefUnwindSafe for TensorIterElement
impl Unpin for TensorIterElement
impl UnwindSafe for TensorIterElement
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<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