pub struct TensorBinding<R: Runtime> {
pub handle: Binding,
pub strides: Strides,
pub shape: Shape,
pub runtime: PhantomData<R>,
}Expand description
Tensor representation with a reference to the server handle, the strides and the shape.
Fields§
§handle: Binding§strides: Strides§shape: Shape§runtime: PhantomData<R>Implementations§
Source§impl<R: Runtime> TensorBinding<R>
impl<R: Runtime> TensorBinding<R>
pub fn size(&self) -> usize
Sourcepub fn required_address_type(&self, elem_size: usize) -> AddressType
pub fn required_address_type(&self, elem_size: usize) -> AddressType
Address type required to fully index this tensor handle, assuming scalar access.
Source§impl<R: Runtime> TensorBinding<R>
impl<R: Runtime> TensorBinding<R>
Sourcepub fn into_tensor_arg(self) -> TensorArg<R>
pub fn into_tensor_arg(self) -> TensorArg<R>
Convert the handle into a tensor argument.
Sourcepub fn into_alias(self, index: usize) -> TensorArg<R>
pub fn into_alias(self, index: usize) -> TensorArg<R>
Convert the handle into a tensor argument.
Sourcepub fn as_alias(&self, index: usize) -> TensorArg<R>
pub fn as_alias(&self, index: usize) -> TensorArg<R>
Convert the handle into a tensor argument.
Sourcepub fn into_array_arg(self) -> ArrayArg<R>
pub fn into_array_arg(self) -> ArrayArg<R>
Convert the handle into an array argument.
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 handle from raw parts.
§Safety
If you provide wrong strides or shapes, it might create undefined behavior caused by out-of-bounds reads and writes.
Sourcepub unsafe fn from_raw_parts_binding(
handle: Binding,
strides: Strides,
shape: Shape,
) -> Self
pub unsafe fn from_raw_parts_binding( handle: Binding, strides: Strides, shape: Shape, ) -> Self
Create a handle from raw parts.
§Safety
If you provide wrong strides or shapes, it might create undefined behavior caused by out-of-bounds reads and writes.
pub fn into_copy_descriptor(self, elem_size: usize) -> CopyDescriptor
Trait Implementations§
Source§impl<R: Runtime> Clone for TensorBinding<R>
impl<R: Runtime> Clone for TensorBinding<R>
Auto Trait Implementations§
impl<R> Freeze for TensorBinding<R>
impl<R> !RefUnwindSafe for TensorBinding<R>
impl<R> Send for TensorBinding<R>
impl<R> Sync for TensorBinding<R>
impl<R> Unpin for TensorBinding<R>where
R: Unpin,
impl<R> UnsafeUnpin for TensorBinding<R>
impl<R> !UnwindSafe for TensorBinding<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