pub struct TensorHandle<R>where
R: Runtime,{
pub handle: Handle,
pub metadata: Box<Metadata>,
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.
metadata: Box<Metadata>§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: impl Into<Shape>,
strides: impl Into<Strides>,
storage: impl Into<Type>,
) -> Self
pub fn new( handle: Handle, shape: impl Into<Shape>, strides: impl Into<Strides>, storage: impl Into<Type>, ) -> Self
Create a new tensor.
pub fn empty( client: &ComputeClient<R>, shape: impl Into<Shape>, storage: impl Into<Type>, ) -> Self
Sourcepub fn new_contiguous(
shape: impl Into<Shape>,
handle: Handle,
storage: StorageType,
) -> Self
pub fn new_contiguous( shape: impl Into<Shape>, handle: Handle, storage: StorageType, ) -> Self
Create a new tensor with a contiguous memory layout.
pub fn binding(self) -> TensorBinding<R>
pub fn into_copy_descriptor(self) -> CopyDescriptor
pub fn required_address_type(&self) -> AddressType
pub fn shape(&self) -> &Shape
pub fn strides(&self) -> &Strides
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>
impl<R> Send for TensorHandle<R>
impl<R> Sync for TensorHandle<R>
impl<R> Unpin for TensorHandle<R>where
R: Unpin,
impl<R> UnsafeUnpin for TensorHandle<R>
impl<R> !UnwindSafe for TensorHandle<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