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>
impl<'t, 'tl> TensorInfoMut<'t, 'tl>
Sourcepub fn tensor<H: HalideType>(&self) -> Result<&TensorRef<H, Device>>
pub fn tensor<H: HalideType>(&self) -> Result<&TensorRef<H, Device>>
Get the tensor with the specified type
Sourcepub fn tensor_mut<H: HalideType>(&mut self) -> Result<&mut TensorRef<H, Device>>
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.
Sourcepub fn into_tensor_mut<H: HalideType>(
self,
) -> Result<&'tl mut TensorRef<H, Device>>
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.
Sourcepub unsafe fn tensor_unresized<H: HalideType>(
&mut self,
) -> Result<&mut TensorRef<H, Device>>
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
Sourcepub fn raw_tensor(&self) -> &AnyTensorRef
pub fn raw_tensor(&self) -> &AnyTensorRef
This function return’s the raw tensor without any sort of type-checking or shape-checking
Sourcepub fn raw_tensor_mut(&mut self) -> &mut AnyTensorRef
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