Skip to main content

TensorListMut

Struct TensorListMut 

Source
pub struct TensorListMut<'t> { /* private fields */ }
Expand description

A list of tensors returned by interpreter input queries.

This list is created from a &mut Session and therefore has exclusive access to the tensors it describes, which is what allows it to hand out &mut TensorRefs. It dereferences to TensorList for all the read-only operations.

Implementations§

Source§

impl<'t> TensorListMut<'t>

Source

pub fn get_mut(&mut self, index: usize) -> Option<TensorInfoMut<'t, '_>>

Get a mutable reference to the tensor at the given index

Source

pub fn iter_mut<'tl>(&'tl mut self) -> TensorListIterMut<'t, 'tl> ⓘ

Get a mutable iterator over the tensor list

Methods from Deref<Target = TensorList<'t>>§

Source

pub fn size(&self) -> usize

Returns the size of the tensor list

Source

pub fn get(&self, index: usize) -> Option<TensorInfo<'t, '_>>

Get the tensor at the given index

Source

pub fn iter<'tl>(&'tl self) -> TensorListIter<'t, 'tl> ⓘ

Get an iterator over the tensor list

Trait Implementations§

Source§

impl Debug for TensorListMut<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'t> Deref for TensorListMut<'t>

Source§

type Target = TensorList<'t>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'t, 'tl> IntoIterator for &'tl TensorListMut<'t>

Source§

type Item = TensorInfo<'t, 'tl>

The type of the elements being iterated over.
Source§

type IntoIter = TensorListIter<'t, 'tl>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'t, 'tl> IntoIterator for &'tl mut TensorListMut<'t>

Source§

type Item = TensorInfoMut<'t, 'tl>

The type of the elements being iterated over.
Source§

type IntoIter = TensorListIterMut<'t, 'tl>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'t> Freeze for TensorListMut<'t>

§

impl<'t> RefUnwindSafe for TensorListMut<'t>

§

impl<'t> !Send for TensorListMut<'t>

§

impl<'t> !Sync for TensorListMut<'t>

§

impl<'t> Unpin for TensorListMut<'t>

§

impl<'t> UnsafeUnpin for TensorListMut<'t>

§

impl<'t> UnwindSafe for TensorListMut<'t>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> MaybeDebug for T
where T: Debug,