Skip to main content

Extent

Enum Extent 

Source
pub enum Extent {
    Scalar(usize),
    Range {
        min: usize,
        max: usize,
        sym: SymId,
    },
}
Expand description

A single dimension’s extent: a build-time constant, or a bounded runtime symbol.

Shape::dims() reports the bound (a Scalar’s value, or a Range’s max/capacity) — which is what sizing/striding/iteration want. The live value of a Range is resolved per forward pass through a SymEnv. Scalar carries no symbol: two build-time constants that must match already match by being equal, and a runtime dimension always has a capacity bound, so it is a Range, never a Scalar.

Phase D step 1b. See docs/session-prompts/symbolic-extents-and-persistent-decode.md.

Variants§

§

Scalar(usize)

A dimension fixed at graph-construction time.

§

Range

A bounded runtime dimension: live value in [min, max], resolved via the SymEnv under sym. max is the capacity (what dims() reports).

Fields

§min: usize
§max: usize
§sym: SymId

Implementations§

Source§

impl Extent

Source

pub fn bound(&self) -> usize

The capacity bound: a Scalar’s value, or a Range’s max. This is what Shape::dims() reports for the axis.

Source

pub fn min(&self) -> usize

The lower bound: a Scalar’s value, or a Range’s min.

Source

pub fn is_dynamic(&self) -> bool

Whether this is a runtime (Range) extent rather than a constant.

Source

pub fn sym(&self) -> Option<SymId>

The symbol of a Range, or None for a Scalar.

Source

pub fn resolve(&self, env: &SymEnv) -> Option<usize>

The live value this pass: a Scalar’s value, or the Range’s sym resolved through env. None if a Range’s symbol is unbound.

Trait Implementations§

Source§

impl Clone for Extent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Extent

Source§

impl Debug for Extent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Extent

Source§

impl Hash for Extent

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Extent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Extent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V