pub struct JitTensor<R, E>where
R: JitRuntime,
E: JitElement,{
pub client: ComputeClient<R::Server, R::Channel>,
pub handle: Handle,
pub shape: Shape,
pub device: R::Device,
pub strides: Vec<usize>,
/* private fields */
}Expand description
The basic tensor primitive struct.
Fields§
§client: ComputeClient<R::Server, R::Channel>Compute client for the runtime.
handle: HandleThe buffer where the data are stored.
shape: ShapeThe shape of the tensor.
device: R::DeviceThe device of the tensor.
strides: Vec<usize>The strides of the tensor.
Implementations§
Source§impl<R, E> JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
impl<R, E> JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
Source§impl<R, E> JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
impl<R, E> JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
Sourcepub fn new_contiguous(
client: ComputeClient<R::Server, R::Channel>,
device: R::Device,
shape: Shape,
handle: Handle,
) -> Self
pub fn new_contiguous( client: ComputeClient<R::Server, R::Channel>, device: R::Device, shape: Shape, handle: Handle, ) -> Self
Create a new tensor with a contiguous memory layout.
Sourcepub fn to_client(
&self,
client: ComputeClient<R::Server, R::Channel>,
device: R::Device,
) -> Self
pub fn to_client( &self, client: ComputeClient<R::Server, R::Channel>, device: R::Device, ) -> Self
Change the context of the current tensor and return the newly transferred tensor.
Sourcepub fn as_handle_ref(&self) -> TensorHandleRef<'_, R>
pub fn as_handle_ref(&self) -> TensorHandleRef<'_, R>
Return the reference to a tensor handle.
Sourcepub fn as_tensor_arg<'a>(&'a self, vectorisation: u8) -> TensorArg<'a, R>
pub fn as_tensor_arg<'a>(&'a self, vectorisation: u8) -> TensorArg<'a, R>
Return the reference to a tensor argument.
Sourcepub fn assert_is_on_same_device(&self, other: &Self)
pub fn assert_is_on_same_device(&self, other: &Self)
Assert that both tensors are on the same device.
Sourcepub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
Check if the current tensor is contiguous.
Trait Implementations§
Source§impl<R, E> Clone for JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
impl<R, E> Clone for JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
Source§impl<R, E> Debug for JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
impl<R, E> Debug for JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
Source§impl<R: JitRuntime, E: JitElement> From<JitTensor<R, E>> for TensorHandle<R, E>
impl<R: JitRuntime, E: JitElement> From<JitTensor<R, E>> for TensorHandle<R, E>
Auto Trait Implementations§
impl<R, E> Freeze for JitTensor<R, E>
impl<R, E> !RefUnwindSafe for JitTensor<R, E>
impl<R, E> Send for JitTensor<R, E>
impl<R, E> Sync for JitTensor<R, E>
impl<R, E> Unpin for JitTensor<R, E>
impl<R, E> !UnwindSafe for JitTensor<R, E>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)