pub struct JitTensor<R, E, const D: usize>where
R: JitRuntime,
E: JitElement,{
pub client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>,
pub handle: Handle<<R as Runtime>::Server>,
pub shape: Shape<D>,
pub device: <R as Runtime>::Device,
pub strides: [usize; D],
/* 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<<R as Runtime>::Server>
The buffer where the data are stored.
shape: Shape<D>
The shape of the tensor.
device: <R as Runtime>::Device
The device of the tensor.
strides: [usize; D]
The strides of the tensor.
Implementations§
§impl<R, E, const D: usize> JitTensor<R, E, D>where
R: JitRuntime,
E: JitElement,
impl<R, E, const D: usize> JitTensor<R, E, D>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<D>,
handle: Handle<<R as Runtime>::Server>,
) -> JitTensor<R, E, D>
pub fn new_contiguous( client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>, device: <R as Runtime>::Device, shape: Shape<D>, handle: Handle<<R as Runtime>::Server>, ) -> JitTensor<R, E, D>
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, D>
pub fn to_client( &self, client: ComputeClient<<R as Runtime>::Server, <R as Runtime>::Channel>, device: <R as Runtime>::Device, ) -> JitTensor<R, E, D>
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, D>)
pub fn assert_is_on_same_device(&self, other: &JitTensor<R, E, D>)
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, const D: usize> Freeze for JitTensor<R, E, D>
impl<R, E, const D: usize> RefUnwindSafe for JitTensor<R, E, D>where
<R as JitRuntime>::JitDevice: RefUnwindSafe,
<R as Runtime>::Channel: RefUnwindSafe,
<<<R as JitRuntime>::JitServer as ComputeServer>::MemoryManagement as MemoryManagement<<<R as JitRuntime>::JitServer as ComputeServer>::Storage>>::Handle: RefUnwindSafe,
E: RefUnwindSafe,
<<R as JitRuntime>::JitServer as ComputeServer>::FeatureSet: RefUnwindSafe,
impl<R, E, const D: usize> Send for JitTensor<R, E, D>
impl<R, E, const D: usize> Sync for JitTensor<R, E, D>
impl<R, E, const D: usize> Unpin for JitTensor<R, E, D>
impl<R, E, const D: usize> UnwindSafe for JitTensor<R, E, D>where
<R as JitRuntime>::JitDevice: UnwindSafe,
<R as Runtime>::Channel: UnwindSafe,
<<<R as JitRuntime>::JitServer as ComputeServer>::MemoryManagement as MemoryManagement<<<R as JitRuntime>::JitServer as ComputeServer>::Storage>>::Handle: UnwindSafe,
E: UnwindSafe,
<<R as JitRuntime>::JitServer as ComputeServer>::FeatureSet: RefUnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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