pub struct ArrayHandleRef<'a, R: Runtime> {
pub handle: &'a Handle,
pub elem_size: usize,
/* private fields */
}
Expand description
Tensor representation with a reference to the server handle.
Fields§
§handle: &'a Handle
§elem_size: usize
Implementations§
Source§impl<'a, R: Runtime> ArrayHandleRef<'a, R>
impl<'a, R: Runtime> ArrayHandleRef<'a, R>
Sourcepub unsafe fn from_raw_parts(
handle: &'a Handle,
length: usize,
elem_size: usize,
) -> Self
pub unsafe fn from_raw_parts( handle: &'a Handle, length: usize, elem_size: usize, ) -> Self
Create a new array handle reference.
§Safety
Specifying the wrong length may lead to out-of-bounds reads and writes.
Sourcepub fn as_tensor(&self) -> TensorHandleRef<'_, R>
pub fn as_tensor(&self) -> TensorHandleRef<'_, R>
Return the handle as a tensor instead of an array.
Auto Trait Implementations§
impl<'a, R> Freeze for ArrayHandleRef<'a, R>
impl<'a, R> RefUnwindSafe for ArrayHandleRef<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for ArrayHandleRef<'a, R>
impl<'a, R> Sync for ArrayHandleRef<'a, R>
impl<'a, R> Unpin for ArrayHandleRef<'a, R>where
R: Unpin,
impl<'a, R> UnwindSafe for ArrayHandleRef<'a, R>where
R: UnwindSafe,
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