Enum executorch_sys::torch::executor::TensorShapeDynamism
source · #[repr(u8)]pub enum TensorShapeDynamism {
STATIC = 0,
DYNAMIC_BOUND = 1,
DYNAMIC_UNBOUND = 2,
}Expand description
Rank can never change in executorch. But shape sometimes can. This enum is used to help provide better safety in kernels on what tensors are resizable
WARNING: This abstraction is only temporary. The long term vision is that this wont exist in the runtime. Instead the runtime will support a debug mode that allows for similar fail early patterns without having to pay the runtime cost of directly embedding this abstraction in tensor and performing checks against it during resizing. Adding this debug mode is non trivial though so for the short term this abstraction helps us move fast. TODO(jakeszwe): T134528146
Variants§
STATIC = 0
Cannot change shape
DYNAMIC_BOUND = 1
shape cannot exceed initial capacity
DYNAMIC_UNBOUND = 2
No restriction on shape and capacity
Trait Implementations§
source§impl Clone for TensorShapeDynamism
impl Clone for TensorShapeDynamism
source§fn clone(&self) -> TensorShapeDynamism
fn clone(&self) -> TensorShapeDynamism
Returns a copy of the value. Read more
1.0.0 · 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 TensorShapeDynamism
impl Debug for TensorShapeDynamism
source§impl Hash for TensorShapeDynamism
impl Hash for TensorShapeDynamism
source§impl PartialEq for TensorShapeDynamism
impl PartialEq for TensorShapeDynamism
impl Eq for TensorShapeDynamism
impl StructuralPartialEq for TensorShapeDynamism
Auto Trait Implementations§
impl Freeze for TensorShapeDynamism
impl RefUnwindSafe for TensorShapeDynamism
impl Send for TensorShapeDynamism
impl Sync for TensorShapeDynamism
impl Unpin for TensorShapeDynamism
impl UnwindSafe for TensorShapeDynamism
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)