pub struct NamedTensors { /* private fields */ }Expand description
Ordered, uniquely named tensor collection.
Implementations§
Source§impl NamedTensors
impl NamedTensors
Sourcepub fn insert(
&mut self,
name: impl Into<String>,
tensor: TensorBuffer,
) -> AiResult<()>
pub fn insert( &mut self, name: impl Into<String>, tensor: TensorBuffer, ) -> AiResult<()>
Inserts a unique named tensor while retaining insertion order.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &TensorBuffer)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &TensorBuffer)>
Returns ordered (name, tensor) pairs.
Sourcepub fn into_values(self) -> Vec<(String, TensorBuffer)>
pub fn into_values(self) -> Vec<(String, TensorBuffer)>
Consumes the collection into ordered pairs.
Trait Implementations§
Source§impl Clone for NamedTensors
impl Clone for NamedTensors
Source§fn clone(&self) -> NamedTensors
fn clone(&self) -> NamedTensors
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 NamedTensors
impl Debug for NamedTensors
Source§impl Default for NamedTensors
impl Default for NamedTensors
Source§fn default() -> NamedTensors
fn default() -> NamedTensors
Returns the “default value” for a type. Read more
Source§impl PartialEq for NamedTensors
impl PartialEq for NamedTensors
Source§fn eq(&self, other: &NamedTensors) -> bool
fn eq(&self, other: &NamedTensors) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for NamedTensors
impl StructuralPartialEq for NamedTensors
Auto Trait Implementations§
impl Freeze for NamedTensors
impl !RefUnwindSafe for NamedTensors
impl Send for NamedTensors
impl Sync for NamedTensors
impl Unpin for NamedTensors
impl UnsafeUnpin for NamedTensors
impl !UnwindSafe for NamedTensors
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