Skip to main content

TensorInfoMut

Struct TensorInfoMut 

Source
pub struct TensorInfoMut<'t, 'tl> { /* private fields */ }
Expand description

Mutable information about a tensor in a tensor list

Each TensorInfoMut represents exclusive access to one entry of a TensorListMut for the lifetime 'tl.

Implementations§

Source§

impl<'t, 'tl> TensorInfoMut<'t, 'tl>

Source

pub fn name(&self) -> &'tl str

Get the name of the tensor

Source

pub fn tensor<H: HalideType>(&self) -> Result<&TensorRef<H, Device>>

Get the tensor with the specified type

Source

pub fn tensor_mut<H: HalideType>(&mut self) -> Result<&mut TensorRef<H, Device>>

Get a mutable reference to the tensor with the specified type

The returned reference borrows self mutably, use Self::into_tensor_mut if you need a reference that lives as long as the list borrow.

Source

pub fn into_tensor_mut<H: HalideType>( self, ) -> Result<&'tl mut TensorRef<H, Device>>

Consume this entry and get a mutable reference to the tensor that lives as long as the borrow of the TensorListMut this entry came from.

Source

pub unsafe fn tensor_unresized<H: HalideType>( &mut self, ) -> Result<&mut TensorRef<H, Device>>

§Safety

The shape is not checked so it’s marked unsafe since futher calls to interpreter might be unsafe with this

Source

pub fn raw_tensor(&self) -> &AnyTensorRef

This function return’s the raw tensor without any sort of type-checking or shape-checking

Source

pub fn raw_tensor_mut(&mut self) -> &mut AnyTensorRef

This function return’s the raw tensor mutably without any sort of type-checking or shape-checking

Trait Implementations§

Source§

impl Debug for TensorInfoMut<'_, '_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t, 'tl> Freeze for TensorInfoMut<'t, 'tl>

§

impl<'t, 'tl> RefUnwindSafe for TensorInfoMut<'t, 'tl>

§

impl<'t, 'tl> !Send for TensorInfoMut<'t, 'tl>

§

impl<'t, 'tl> !Sync for TensorInfoMut<'t, 'tl>

§

impl<'t, 'tl> Unpin for TensorInfoMut<'t, 'tl>

§

impl<'t, 'tl> UnsafeUnpin for TensorInfoMut<'t, 'tl>

§

impl<'t, 'tl> !UnwindSafe for TensorInfoMut<'t, 'tl>

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<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,