pub enum TensorState<R: Runtime> {
Empty,
Some {
buffers: Vec<Binding>,
tensor_maps: Vec<TensorMapBinding>,
metadata: MetadataBuilder,
runtime: PhantomData<R>,
},
}
Expand description
Handles the tensor state.
Variants§
Empty
No tensor is registered yet.
Some
The registered tensors.
Implementations§
Source§impl<R: Runtime> TensorState<R>
impl<R: Runtime> TensorState<R>
Sourcepub fn push_tensor(&mut self, tensor: &TensorArg<'_, R>)
pub fn push_tensor(&mut self, tensor: &TensorArg<'_, R>)
Push a new input tensor to the state.
Sourcepub fn push_array(&mut self, array: &ArrayArg<'_, R>)
pub fn push_array(&mut self, array: &ArrayArg<'_, R>)
Push a new input array to the state.
Sourcepub fn push_tensor_map(&mut self, map: &TensorMapArg<'_, R>)
pub fn push_tensor_map(&mut self, map: &TensorMapArg<'_, R>)
Push a new tensor to the state.
Auto Trait Implementations§
impl<R> Freeze for TensorState<R>
impl<R> RefUnwindSafe for TensorState<R>where
R: RefUnwindSafe,
impl<R> Send for TensorState<R>
impl<R> Sync for TensorState<R>
impl<R> Unpin for TensorState<R>where
R: Unpin,
impl<R> UnwindSafe for TensorState<R>where
R: UnwindSafe,
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