pub struct PreparedInputPart<Tensor> { /* private fields */ }Expand description
One owned, typed, ordered prepared input part.
Implementations§
Source§impl<Tensor> PreparedInputPart<Tensor>
impl<Tensor> PreparedInputPart<Tensor>
Sourcepub fn new(
modality: InputModality,
payload: PreparedInputPayload<Tensor>,
metadata: impl IntoIterator<Item = (InputMetadataKey, Tensor)>,
) -> Result<Self, PreparedInputError>
pub fn new( modality: InputModality, payload: PreparedInputPayload<Tensor>, metadata: impl IntoIterator<Item = (InputMetadataKey, Tensor)>, ) -> Result<Self, PreparedInputError>
Creates a part with compatible payload and unique, compatible metadata.
Sourcepub fn new_with_extents(
modality: InputModality,
payload: PreparedInputPayload<Tensor>,
metadata: impl IntoIterator<Item = (InputMetadataKey, Tensor)>,
extents: impl IntoIterator<Item = InputExtent>,
) -> Result<Self, PreparedInputError>
pub fn new_with_extents( modality: InputModality, payload: PreparedInputPayload<Tensor>, metadata: impl IntoIterator<Item = (InputMetadataKey, Tensor)>, extents: impl IntoIterator<Item = InputExtent>, ) -> Result<Self, PreparedInputError>
Creates a part with compatible host-known execution extents.
Sourcepub const fn modality(&self) -> InputModality
pub const fn modality(&self) -> InputModality
Part modality.
Sourcepub const fn payload(&self) -> &PreparedInputPayload<Tensor>
pub const fn payload(&self) -> &PreparedInputPayload<Tensor>
Primary tensor and semantic role.
Sourcepub const fn metadata(&self) -> &BTreeMap<InputMetadataKey, Tensor>
pub const fn metadata(&self) -> &BTreeMap<InputMetadataKey, Tensor>
Typed metadata tensors in stable key order.
Sourcepub fn metadata_value(&self, key: InputMetadataKey) -> Option<&Tensor>
pub fn metadata_value(&self, key: InputMetadataKey) -> Option<&Tensor>
Looks up one metadata tensor.
Sourcepub fn extents(&self) -> &[InputExtent]
pub fn extents(&self) -> &[InputExtent]
Host-known extents needed by accelerator execution.
Sourcepub fn descriptor(
&self,
describe: &impl Fn(&Tensor) -> Result<InputTensorIdentity, PreparedInputError>,
) -> Result<InputPartDescriptor, PreparedInputError>
pub fn descriptor( &self, describe: &impl Fn(&Tensor) -> Result<InputTensorIdentity, PreparedInputError>, ) -> Result<InputPartDescriptor, PreparedInputError>
Builds and validates the core descriptor for this exact tensor part.
Trait Implementations§
Source§impl<Tensor: Clone> Clone for PreparedInputPart<Tensor>
impl<Tensor: Clone> Clone for PreparedInputPart<Tensor>
Source§fn clone(&self) -> PreparedInputPart<Tensor>
fn clone(&self) -> PreparedInputPart<Tensor>
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<Tensor: Debug> Debug for PreparedInputPart<Tensor>
impl<Tensor: Debug> Debug for PreparedInputPart<Tensor>
impl<Tensor: Eq> Eq for PreparedInputPart<Tensor>
Source§impl<Tensor: PartialEq> PartialEq for PreparedInputPart<Tensor>
impl<Tensor: PartialEq> PartialEq for PreparedInputPart<Tensor>
impl<Tensor: PartialEq> StructuralPartialEq for PreparedInputPart<Tensor>
Auto Trait Implementations§
impl<Tensor> Freeze for PreparedInputPart<Tensor>
impl<Tensor> RefUnwindSafe for PreparedInputPart<Tensor>where
PreparedInputPayload<Tensor>: RefUnwindSafe,
BTreeMap<InputMetadataKey, Tensor>: RefUnwindSafe,
impl<Tensor> Send for PreparedInputPart<Tensor>
impl<Tensor> Sync for PreparedInputPart<Tensor>
impl<Tensor> Unpin for PreparedInputPart<Tensor>
impl<Tensor> UnsafeUnpin for PreparedInputPart<Tensor>
impl<Tensor> UnwindSafe for PreparedInputPart<Tensor>
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