pub struct TensorHandle<R, E>where
R: Runtime,
E: CubePrimitive,{
pub handle: Handle,
pub shape: Vec<usize>,
pub strides: Vec<usize>,
/* private fields */
}
Expand description
Tensor representation containing a server handle as well as basic tensor metadata.,
Fields§
§handle: Handle
The buffer where the data are stored.
shape: Vec<usize>
§strides: Vec<usize>
Implementations§
Source§impl<R, E> TensorHandle<R, E>where
R: Runtime,
E: CubePrimitive,
impl<R, E> TensorHandle<R, E>where
R: Runtime,
E: CubePrimitive,
Sourcepub fn new(handle: Handle, shape: Vec<usize>, strides: Vec<usize>) -> Self
pub fn new(handle: Handle, shape: Vec<usize>, strides: Vec<usize>) -> Self
Create a new tensor.
pub fn empty( client: &ComputeClient<R::Server, R::Channel>, shape: Vec<usize>, ) -> Self
Sourcepub fn from_ref(handle: &TensorHandleRef<'_, R>) -> Self
pub fn from_ref(handle: &TensorHandleRef<'_, R>) -> Self
Create a new tensor.
Sourcepub fn new_contiguous(shape: Vec<usize>, handle: Handle) -> Self
pub fn new_contiguous(shape: Vec<usize>, handle: Handle) -> Self
Create a new tensor with a contiguous memory layout.
pub fn as_ref(&self) -> TensorHandleRef<'_, R>
Trait Implementations§
Source§impl<R, E> Clone for TensorHandle<R, E>where
R: Runtime,
E: CubePrimitive,
impl<R, E> Clone for TensorHandle<R, E>where
R: Runtime,
E: CubePrimitive,
Auto Trait Implementations§
impl<R, E> Freeze for TensorHandle<R, E>
impl<R, E> RefUnwindSafe for TensorHandle<R, E>where
E: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, E> Send for TensorHandle<R, E>
impl<R, E> Sync for TensorHandle<R, E>
impl<R, E> Unpin for TensorHandle<R, E>
impl<R, E> UnwindSafe for TensorHandle<R, E>where
E: UnwindSafe,
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