pub struct DLPackTensor { /* private fields */ }Expand description
Safe wrapper owning a legacy DLPack managed tensor. Calls the deleter on drop.
This is the return type of NdArray::to_dlpack(), analogous to how
to_apache_arrow() returns an ArrayRef that owns its lifecycle.
Implementations§
Source§impl DLPackTensor
impl DLPackTensor
Sourcepub fn into_raw(self) -> *mut DLManagedTensor
pub fn into_raw(self) -> *mut DLManagedTensor
Raw pointer access for FFI consumers that need to take ownership e.g. when creating a PyCapsule.
After calling this, the DLPackTensor no longer owns the pointer and will not call the deleter on drop. The caller is responsible for ensuring the deleter is called.
Trait Implementations§
Source§impl Drop for DLPackTensor
impl Drop for DLPackTensor
Auto Trait Implementations§
impl !Send for DLPackTensor
impl !Sync for DLPackTensor
impl Freeze for DLPackTensor
impl RefUnwindSafe for DLPackTensor
impl Unpin for DLPackTensor
impl UnsafeUnpin for DLPackTensor
impl UnwindSafe for DLPackTensor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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