pub enum Input<'a> {
Owned(Mat),
Borrowed {
values: &'a [f32],
dimensions: &'a [usize],
},
View(&'a MatView<'a>),
}Expand description
One input of a request.
The variant decides what the call does with the storage. Input::Owned transfers a tensor the
crate created or cloned, Input::Borrowed reads FP32 values where the caller keeps them, and
Input::View reads a region of an existing tensor without copying it. A borrowed entry is
only valid for the call that receives it, which is why Net::infer and
Net::infer_into bound the borrow themselves.
Variants§
Owned(Mat)
Tensor storage this request owns.
Borrowed
Unpacked FP32 values and their extents, read where the caller keeps them.
Fields
View(&'a MatView<'a>)
A tensor sub view, which keeps no storage of its own.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Send for Input<'a>
impl<'a> !Sync for Input<'a>
impl<'a> Freeze for Input<'a>
impl<'a> RefUnwindSafe for Input<'a>
impl<'a> Unpin for Input<'a>
impl<'a> UnsafeUnpin for Input<'a>
impl<'a> UnwindSafe for Input<'a>
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