pub enum TensorArg<R: Runtime> {
Handle {
handle: TensorBinding<R>,
},
Alias {
input_pos: usize,
strides: Strides,
shape: Shape,
},
}Expand description
Argument to be used for tensors passed as arguments to kernels.
Variants§
Handle
The tensor is passed with a tensor handle.
Fields
§
handle: TensorBinding<R>The tensor handle.
Alias
The tensor is aliasing another input tensor.
Implementations§
Source§impl<R: Runtime> TensorArg<R>
impl<R: Runtime> TensorArg<R>
Sourcepub unsafe fn from_raw_parts(
handle: Handle,
strides: Strides,
shape: Shape,
) -> Self
pub unsafe fn from_raw_parts( handle: Handle, strides: Strides, shape: Shape, ) -> Self
Create a new tensor argument specified with its vectorization factor.
§Safety
If you provide wrong strides or shapes, it might create undefined behavior caused by out-of-bound reads and writes.
Sourcepub fn into_alias(self, position: usize) -> Self
pub fn into_alias(self, position: usize) -> Self
Create an alias argument.
pub fn size(&self) -> usize
pub fn shape(&self) -> &[usize]
pub fn strides(&self) -> &[usize]
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for TensorArg<R>
impl<R> !RefUnwindSafe for TensorArg<R>
impl<R> Send for TensorArg<R>
impl<R> Sync for TensorArg<R>
impl<R> Unpin for TensorArg<R>where
R: Unpin,
impl<R> UnsafeUnpin for TensorArg<R>
impl<R> !UnwindSafe for TensorArg<R>
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