Enum safetensors::slice::TensorIndexer
source · pub enum TensorIndexer {
Select(usize),
Narrow(Bound<usize>, Bound<usize>),
}
Expand description
Generic structure used to index a slice of the tensor
Variants§
Select(usize)
This is selecting an entire dimension
Narrow(Bound<usize>, Bound<usize>)
This is a regular slice, purely indexing a chunk of the tensor
Trait Implementations§
source§impl Clone for TensorIndexer
impl Clone for TensorIndexer
source§fn clone(&self) -> TensorIndexer
fn clone(&self) -> TensorIndexer
Returns a copy of the value. Read more
1.0.0 · 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 TensorIndexer
impl Debug for TensorIndexer
source§impl Display for TensorIndexer
impl Display for TensorIndexer
Intended for Python users mostly or at least for its conventions
source§impl From<RangeFull> for TensorIndexer
impl From<RangeFull> for TensorIndexer
source§impl From<RangeInclusive<usize>> for TensorIndexer
impl From<RangeInclusive<usize>> for TensorIndexer
source§fn from(range: RangeInclusive<usize>) -> Self
fn from(range: RangeInclusive<usize>) -> Self
Converts to this type from the input type.
source§impl From<RangeToInclusive<usize>> for TensorIndexer
impl From<RangeToInclusive<usize>> for TensorIndexer
source§fn from(range: RangeToInclusive<usize>) -> Self
fn from(range: RangeToInclusive<usize>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TensorIndexer
impl RefUnwindSafe for TensorIndexer
impl Send for TensorIndexer
impl Sync for TensorIndexer
impl Unpin for TensorIndexer
impl UnwindSafe for TensorIndexer
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