pub struct PreallocatedOutput { /* private fields */ }Expand description
Caller-owned mutable bytes for an explicitly bound CPU output.
Implementations§
Source§impl PreallocatedOutput
impl PreallocatedOutput
Sourcepub fn try_new(
name: impl Into<String>,
descriptor: TensorDescriptor,
bytes: Vec<u8>,
) -> AiResult<Self>
pub fn try_new( name: impl Into<String>, descriptor: TensorDescriptor, bytes: Vec<u8>, ) -> AiResult<Self>
Creates a checked preallocated CPU output.
Sourcepub fn allocate(
name: impl Into<String>,
descriptor: TensorDescriptor,
) -> AiResult<Self>
pub fn allocate( name: impl Into<String>, descriptor: TensorDescriptor, ) -> AiResult<Self>
Allocates aligned storage for a compact u8, u16, or f32 CPU output.
Sourcepub const fn descriptor(&self) -> &TensorDescriptor
pub const fn descriptor(&self) -> &TensorDescriptor
Returns output metadata.
Sourcepub fn allocation_bytes_mut(&mut self) -> AiResult<&mut [u8]>
pub fn allocation_bytes_mut(&mut self) -> AiResult<&mut [u8]>
Returns mutable caller-owned output bytes for a backend binding.
Sourcepub fn is_consumed(&self) -> bool
pub fn is_consumed(&self) -> bool
Returns whether a bound run has taken ownership of this allocation.
Sourcepub fn into_tensor(self) -> AiResult<TensorBuffer>
pub fn into_tensor(self) -> AiResult<TensorBuffer>
Converts a completed binding into generic owned tensor storage.
Trait Implementations§
Source§impl Clone for PreallocatedOutput
impl Clone for PreallocatedOutput
Source§fn clone(&self) -> PreallocatedOutput
fn clone(&self) -> PreallocatedOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PreallocatedOutput
impl Debug for PreallocatedOutput
Source§impl PartialEq for PreallocatedOutput
impl PartialEq for PreallocatedOutput
Source§fn eq(&self, other: &PreallocatedOutput) -> bool
fn eq(&self, other: &PreallocatedOutput) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PreallocatedOutput
impl StructuralPartialEq for PreallocatedOutput
Auto Trait Implementations§
impl Freeze for PreallocatedOutput
impl RefUnwindSafe for PreallocatedOutput
impl Send for PreallocatedOutput
impl Sync for PreallocatedOutput
impl Unpin for PreallocatedOutput
impl UnsafeUnpin for PreallocatedOutput
impl UnwindSafe for PreallocatedOutput
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