pub struct DispatchTensor {
pub kind: DispatchTensorKind,
pub checkpointing: Option<CheckpointingStrategy>,
}Expand description
A tensor that can dispatch operations to any enabled backend at runtime.
When the autodiff feature is enabled, tensors may carry a checkpointing
strategy used to control gradient computation. This is derived from the
device used to create the tensor.
Fields§
§kind: DispatchTensorKindTensor kind primitive.
checkpointing: Option<CheckpointingStrategy>Holds the autodiff checkpointing strategy.
None: tensor is not tracked by autodiffSome(strategy): tensor is tracked by autodiff, and uses the checkpointingstrategy
Trait Implementations§
Source§impl Clone for DispatchTensor
impl Clone for DispatchTensor
Source§fn clone(&self) -> DispatchTensor
fn clone(&self) -> DispatchTensor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DispatchTensor
impl Debug for DispatchTensor
Source§impl DispatchKindConversion<Flex> for DispatchTensor
Available on default_backend or crate feature flex only.
impl DispatchKindConversion<Flex> for DispatchTensor
Available on
default_backend or crate feature flex only.Source§fn try_into_backend(
tensor: DispatchTensor,
) -> Result<BackendTensor<Flex>, String>
fn try_into_backend( tensor: DispatchTensor, ) -> Result<BackendTensor<Flex>, String>
Attempts to extract a backend-specific
BackendTensor wrapper from a generic, dynamically-routed DispatchTensor. Read moreSource§fn from_backend(tensor: BackendTensor<Flex>) -> DispatchTensor
fn from_backend(tensor: BackendTensor<Flex>) -> DispatchTensor
Encapsulates a backend-specific tensor variant back into a globally routing
DispatchTensor.Source§impl TensorMetadata for DispatchTensor
impl TensorMetadata for DispatchTensor
Source§type Device = DispatchDevice
type Device = DispatchDevice
The device type associated with the tensor.
Source§fn can_mut(&self) -> bool
fn can_mut(&self) -> bool
Whether the tensor’s buffer can be mutated in place — i.e. this handle
uniquely owns it, so an in-place op (
slice_assign, an inplace kernel)
writes the existing allocation instead of copying it first. Read moreSource§fn scheme(&self) -> QuantScheme
fn scheme(&self) -> QuantScheme
Get the quantization scheme for a quantized float tensor. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DispatchTensor
impl !UnwindSafe for DispatchTensor
impl Freeze for DispatchTensor
impl Send for DispatchTensor
impl Sync for DispatchTensor
impl Unpin for DispatchTensor
impl UnsafeUnpin for DispatchTensor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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