pub struct SequenceValue { /* private fields */ }Expand description
An ordered homogeneous list of immutable, shared tensors.
Implementations§
Source§impl SequenceValue
impl SequenceValue
Sourcepub fn empty(elem_dtype: DataType) -> Self
pub fn empty(elem_dtype: DataType) -> Self
Construct an empty sequence with its declared tensor element dtype.
Sourcepub fn construct(items: Vec<SeqTensor>) -> SequenceResult<Self>
pub fn construct(items: Vec<SeqTensor>) -> SequenceResult<Self>
Construct a sequence without copying any element tensor storage.
Sourcepub fn insert(&self, value: SeqTensor, at: Option<i64>) -> SequenceResult<Self>
pub fn insert(&self, value: SeqTensor, at: Option<i64>) -> SequenceResult<Self>
Return a new sequence with value inserted at at.
None appends. Negative positions count from the end, and len is also
accepted as an explicit append position.
Sourcepub fn erase(&self, at: Option<i64>) -> SequenceResult<Self>
pub fn erase(&self, at: Option<i64>) -> SequenceResult<Self>
Return a new sequence with the selected element erased.
None erases the last element. Negative indices count from the end.
Sourcepub fn at(&self, index: i64) -> SequenceResult<SeqTensor>
pub fn at(&self, index: i64) -> SequenceResult<SeqTensor>
Return the selected shared tensor handle. Negative indices count from the end.
Sourcepub fn elem_dtype(&self) -> DataType
pub fn elem_dtype(&self) -> DataType
Declared homogeneous element dtype.
Trait Implementations§
Source§impl Clone for SequenceValue
impl Clone for SequenceValue
Source§fn clone(&self) -> SequenceValue
fn clone(&self) -> SequenceValue
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for SequenceValue
impl !UnwindSafe for SequenceValue
impl Freeze for SequenceValue
impl Send for SequenceValue
impl Sync for SequenceValue
impl Unpin for SequenceValue
impl UnsafeUnpin for SequenceValue
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more