#[repr(C)]pub struct DLManagedTensor {
pub dl_tensor: DLTensor,
pub manager_ctx: *mut c_void,
pub deleter: Option<unsafe extern "C" fn(*mut DLManagedTensor)>,
}Expand description
A managed tensor with ownership semantics.
This corresponds to DLManagedTensor in the DLPack specification.
It wraps a DLTensor and provides a deleter for cleanup.
Fields§
§dl_tensor: DLTensorThe underlying tensor descriptor.
manager_ctx: *mut c_voidOpaque manager context for the producer’s use. Typically used to store data needed by the deleter.
deleter: Option<unsafe extern "C" fn(*mut DLManagedTensor)>Deleter function called when the consumer is done. Can be null if no cleanup is needed.
Auto Trait Implementations§
impl Freeze for DLManagedTensor
impl RefUnwindSafe for DLManagedTensor
impl !Send for DLManagedTensor
impl !Sync for DLManagedTensor
impl Unpin for DLManagedTensor
impl UnwindSafe for DLManagedTensor
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