pub struct JitTensor<R: JitRuntime> {
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: JitRuntime> JitTensor<R>
impl<R: JitRuntime> JitTensor<R>
Source§impl<R> JitTensor<R>where
R: JitRuntime,
impl<R> JitTensor<R>where
R: JitRuntime,
Sourcepub fn new_contiguous(
client: ComputeClient<R::Server, R::Channel>,
device: R::Device,
shape: Shape,
handle: Handle,
dtype: DType,
) -> Self
pub fn new_contiguous( client: ComputeClient<R::Server, R::Channel>, device: R::Device, shape: Shape, handle: Handle, dtype: DType, ) -> 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, E: JitElement>(
&'a self,
vectorisation: u8,
) -> TensorArg<'a, R>
pub fn as_tensor_arg<'a, E: JitElement>( &'a self, vectorisation: u8, ) -> TensorArg<'a, R>
Return the reference to a tensor argument.
Sourcepub fn as_array_arg<E: JitElement>(&self, vectorisation: u8) -> ArrayArg<'_, R>
pub fn as_array_arg<E: JitElement>(&self, vectorisation: u8) -> ArrayArg<'_, R>
Return the reference to an array 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.
Sourcepub fn is_contiguous_buffer(&self) -> bool
pub fn is_contiguous_buffer(&self) -> bool
Check if the current tensor has a contiguous backing buffer (no overlap and no empty memory regions within the shape).
Trait Implementations§
Source§impl<R> Clone for JitTensor<R>where
R: JitRuntime,
impl<R> Clone for JitTensor<R>where
R: JitRuntime,
Source§impl<R> Debug for JitTensor<R>where
R: JitRuntime,
impl<R> Debug for JitTensor<R>where
R: JitRuntime,
Source§impl<R: JitRuntime> From<JitTensor<R>> for JitFusionHandle<R>
Available on crate feature fusion only.
impl<R: JitRuntime> From<JitTensor<R>> for JitFusionHandle<R>
Available on crate feature
fusion only.Source§impl<R: JitRuntime, E: JitElement> From<JitTensor<R>> for TensorHandle<R, E>
impl<R: JitRuntime, E: JitElement> From<JitTensor<R>> for TensorHandle<R, E>
Source§impl<R: JitRuntime> QTensorPrimitive for JitTensor<R>
impl<R: JitRuntime> QTensorPrimitive for JitTensor<R>
Source§fn scheme(&self) -> &QuantizationScheme
fn scheme(&self) -> &QuantizationScheme
Returns the quantization scheme for the given tensor.
Auto Trait Implementations§
impl<R> Freeze for JitTensor<R>
impl<R> !RefUnwindSafe for JitTensor<R>
impl<R> Send for JitTensor<R>
impl<R> Sync for JitTensor<R>
impl<R> Unpin for JitTensor<R>
impl<R> !UnwindSafe for JitTensor<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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