pub struct TensorHandle<R>where
R: Runtime,{
pub handle: Handle,
pub shape: Vec<usize>,
pub strides: Vec<usize>,
pub dtype: StorageType,
/* private fields */
}Expand description
Tensor representation containing a server handle as well as basic tensor metadata.,
Fields§
§handle: HandleThe buffer where the data are stored.
shape: Vec<usize>§strides: Vec<usize>§dtype: StorageTypeThe type used as storage.
Implementations§
Source§impl<R> TensorHandle<R>where
R: Runtime,
impl<R> TensorHandle<R>where
R: Runtime,
Sourcepub fn new(
handle: Handle,
shape: Vec<usize>,
strides: Vec<usize>,
storage: StorageType,
) -> Self
pub fn new( handle: Handle, shape: Vec<usize>, strides: Vec<usize>, storage: StorageType, ) -> Self
Create a new tensor.
pub fn empty( client: &ComputeClient<R::Server>, shape: Vec<usize>, storage: StorageType, ) -> Self
Sourcepub fn from_ref(handle: &TensorHandleRef<'_, R>, storage: StorageType) -> Self
pub fn from_ref(handle: &TensorHandleRef<'_, R>, storage: StorageType) -> Self
Create a new tensor.
Sourcepub fn new_contiguous(
shape: Vec<usize>,
handle: Handle,
storage: StorageType,
) -> Self
pub fn new_contiguous( shape: Vec<usize>, handle: Handle, storage: StorageType, ) -> Self
Create a new tensor with a contiguous memory layout.
pub fn as_ref(&self) -> TensorHandleRef<'_, R>
Sourcepub fn as_arg<'a>(&'a self, vectorisation: u8) -> TensorArg<'a, R>
pub fn as_arg<'a>(&'a self, vectorisation: u8) -> TensorArg<'a, R>
Return the reference to a tensor argument.
pub fn as_copy_descriptor<'a>(&'a self) -> CopyDescriptor<'a>
Source§impl<R> TensorHandle<R>where
R: Runtime,
impl<R> TensorHandle<R>where
R: Runtime,
pub fn zeros( client: &ComputeClient<R::Server>, shape: Vec<usize>, dtype: StorageType, ) -> Self
Trait Implementations§
Source§impl<R> Clone for TensorHandle<R>where
R: Runtime,
impl<R> Clone for TensorHandle<R>where
R: Runtime,
Auto Trait Implementations§
impl<R> Freeze for TensorHandle<R>
impl<R> RefUnwindSafe for TensorHandle<R>where
R: RefUnwindSafe,
impl<R> Send for TensorHandle<R>
impl<R> Sync for TensorHandle<R>
impl<R> Unpin for TensorHandle<R>where
R: Unpin,
impl<R> UnwindSafe for TensorHandle<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