pub struct JitTensor<R, E>where
R: JitRuntime,
E: JitElement,{
pub client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>,
pub handle: Handle,
pub shape: Shape,
pub device: <R as Runtime>::Device,
pub strides: Vec<usize>,
/* private fields */
}
Expand description
The basic tensor primitive struct.
Fields§
§client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>
Compute client for the runtime.
handle: Handle
The buffer where the data are stored.
shape: Shape
The shape of the tensor.
device: <R as Runtime>::Device
The device of the tensor.
strides: Vec<usize>
The strides of the tensor.
Implementations§
§impl<R, E> JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
impl<R, E> JitTensor<R, E>where
R: JitRuntime,
E: JitElement,
pub fn new_contiguous(
client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>,
device: <R as Runtime>::Device,
shape: Shape,
handle: Handle,
) -> JitTensor<R, E>
pub fn new_contiguous( client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>, device: <R as Runtime>::Device, shape: Shape, handle: Handle, ) -> JitTensor<R, E>
Create a new tensor with a contiguous memory layout.
pub fn to_client(
&self,
client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>,
device: <R as Runtime>::Device,
) -> JitTensor<R, E>
pub fn to_client( &self, client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>, device: <R as Runtime>::Device, ) -> JitTensor<R, E>
Change the context of the current tensor and return the newly transferred tensor.
pub fn as_handle_ref(&self) -> TensorHandleRef<'_, R>
pub fn as_handle_ref(&self) -> TensorHandleRef<'_, R>
Return the reference to a tensor handle.
pub 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.
pub fn assert_is_on_same_device(&self, other: &JitTensor<R, E>)
pub fn assert_is_on_same_device(&self, other: &JitTensor<R, E>)
Assert that both tensors are on the same device.
pub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
Check if the current tensor is contiguous.
Trait Implementations§
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
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more