pub struct DlpackManagedTensor { /* private fields */ }Expand description
Owned DLPack tensor handle.
Dropping this value will call the DLPack deleter and free the underlying GPU memory.
Implementations§
Source§impl DlpackManagedTensor
impl DlpackManagedTensor
Sourcepub unsafe fn from_raw(ptr: *mut DLManagedTensor) -> Self
pub unsafe fn from_raw(ptr: *mut DLManagedTensor) -> Self
Construct an owned DLPack tensor from a raw pointer.
§Safety
ptr must be a valid DLManagedTensor* obtained from a DLPack producer, and ownership
must be transferred to the caller (the returned value will call the DLPack deleter on drop).
pub fn as_ptr(&self) -> *mut DLManagedTensor
pub fn into_raw(self) -> *mut DLManagedTensor
Trait Implementations§
Source§impl Drop for DlpackManagedTensor
impl Drop for DlpackManagedTensor
impl Send for DlpackManagedTensor
impl Sync for DlpackManagedTensor
Auto Trait Implementations§
impl Freeze for DlpackManagedTensor
impl RefUnwindSafe for DlpackManagedTensor
impl Unpin for DlpackManagedTensor
impl UnsafeUnpin for DlpackManagedTensor
impl UnwindSafe for DlpackManagedTensor
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