pub struct JitTensor<R, E, const D: usize>where
R: Runtime,
E: JitElement,{
pub client: ComputeClient<R::Server, R::Channel>,
pub handle: Handle<R::Server>,
pub shape: Shape<D>,
pub device: R::Device,
pub strides: [usize; D],
/* private fields */
}Expand description
The basic tensor primitive struct.
Fields§
§client: ComputeClient<R::Server, R::Channel>Compute client for the runtime.
handle: Handle<R::Server>The buffer where the data are stored.
shape: Shape<D>The shape of the tensor.
device: R::DeviceThe device of the tensor.
strides: [usize; D]The strides of the tensor.
Implementations§
source§impl<R, E, const D: usize> JitTensor<R, E, D>where
R: Runtime,
E: JitElement,
impl<R, E, const D: usize> JitTensor<R, E, D>where
R: Runtime,
E: JitElement,
sourcepub fn new(
client: ComputeClient<R::Server, R::Channel>,
device: R::Device,
shape: Shape<D>,
handle: Handle<R::Server>
) -> Self
pub fn new( client: ComputeClient<R::Server, R::Channel>, device: R::Device, shape: Shape<D>, handle: Handle<R::Server> ) -> 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 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§
Auto Trait Implementations§
impl<R, E, const D: usize> Freeze for JitTensor<R, E, D>where
<R as Runtime>::Device: Freeze,
<R as Runtime>::Channel: Freeze,
<<<R as Runtime>::Server as ComputeServer>::MemoryManagement as MemoryManagement<<<R as Runtime>::Server as ComputeServer>::Storage>>::Handle: Freeze,
impl<R, E, const D: usize> RefUnwindSafe for JitTensor<R, E, D>where
<R as Runtime>::Device: RefUnwindSafe,
<R as Runtime>::Channel: RefUnwindSafe,
<<<R as Runtime>::Server as ComputeServer>::MemoryManagement as MemoryManagement<<<R as Runtime>::Server as ComputeServer>::Storage>>::Handle: RefUnwindSafe,
E: 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>where
<R as Runtime>::Device: Unpin,
<R as Runtime>::Channel: Unpin,
<<<R as Runtime>::Server as ComputeServer>::MemoryManagement as MemoryManagement<<<R as Runtime>::Server as ComputeServer>::Storage>>::Handle: Unpin,
E: Unpin,
impl<R, E, const D: usize> UnwindSafe for JitTensor<R, E, D>where
<R as Runtime>::Device: UnwindSafe,
<R as Runtime>::Channel: UnwindSafe,
<<<R as Runtime>::Server as ComputeServer>::MemoryManagement as MemoryManagement<<<R as Runtime>::Server as ComputeServer>::Storage>>::Handle: UnwindSafe,
E: 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