pub struct TensorRef<'s, T> { /* private fields */ }Expand description
Checked read-only device span of a GPU-backed tensor.
Implementations§
Source§impl<'s, T> TensorRef<'s, T>
impl<'s, T> TensorRef<'s, T>
Sourcepub unsafe fn raw_ptr(&self) -> *mut c_void
pub unsafe fn raw_ptr(&self) -> *mut c_void
Extract the device base pointer for an FFI call.
§Safety
The pointer is a read-only view unless the caller’s kernel contract
proves otherwise, and is valid only for lifetime 's for the span
[base, base + byte_len). It must not be retained past the session
scope.
Trait Implementations§
Auto Trait Implementations§
impl<'s, T> !Send for TensorRef<'s, T>
impl<'s, T> !Sync for TensorRef<'s, T>
impl<'s, T> Freeze for TensorRef<'s, T>
impl<'s, T> RefUnwindSafe for TensorRef<'s, T>where
T: RefUnwindSafe,
impl<'s, T> Unpin for TensorRef<'s, T>where
T: Unpin,
impl<'s, T> UnsafeUnpin for TensorRef<'s, T>
impl<'s, T> UnwindSafe for TensorRef<'s, T>where
T: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
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