Skip to main content

Tensor4Shape

Struct Tensor4Shape 

Source
pub struct Tensor4Shape<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize>;
Expand description

Parametric ConstrainedTypeShape for a row-major rank-4 tensor of shape D0 × D1 × D2 × D3 carrying ELEM_BYTES-byte elements.

Per ADR-031’s Tensor<Element, Shape> shape commitment for rank-4. Common GGUF / ONNX usage: batched multi-head attention (batch × heads × seq × dim), 4D conv weight tensors (out_channels × in_channels × kernel_h × kernel_w).

Trait Implementations§

Source§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Clone for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Source§

fn clone(&self) -> Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

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<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> ConstrainedTypeShape for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Source§

const IRI: &'static str = "https://uor.foundation/type/ConstrainedType"

IRI of the ontology type:ConstrainedType instance this shape represents.
Source§

const SITE_COUNT: usize

Number of sites (fields) this constrained type carries.
Source§

const CONSTRAINTS: &'static [ConstraintRef]

Per-site constraint list. Empty means unconstrained.
Source§

const CYCLE_SIZE: u64

ADR-032: cardinality of the shape’s value-set (the cycle structure of the shape under the substrate’s discrete-clock model). Used by the prism_model! macro to lower first_admit (closure-body grammar G16) to the correct descent measure. Conventions: Read more
Source§

const SITE_BUDGET: usize = Self::SITE_COUNT

Ontology-level siteBudget: count of data sites only, excluding bookkeeping introduced by composition (coproduct tag sites, etc.). Equals SITE_COUNT for leaf shapes and for shapes whose composition introduces no bookkeeping (products, cartesian products). Strictly less than SITE_COUNT for coproduct shapes and any shape whose SITE_COUNT includes inherited bookkeeping. Introduced by the Product/Coproduct Completion Amendment §4a; defaults to SITE_COUNT so pre-amendment shape impls remain valid without edits.
Source§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Debug for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Source§

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

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

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Default for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> IntoBindingValue<'a> for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Source§

fn as_binding_value<const INLINE_BYTES: usize>( &self, ) -> TermValue<'a, INLINE_BYTES>

Return this input value’s canonical content-addressable bytes as a source-polymorphic crate::pipeline::TermValue carrier (ADR-060). Inline for values within the derived inline width, Borrowed for larger in-memory values (zero-copy), or Stream for unbounded sources. The carrier borrows the input’s 'a-lived data; for an Inline-only input it owns its bytes and is valid for any 'a.
Source§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Copy for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Source§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> GroundedShape for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Source§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Sealed for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

Auto Trait Implementations§

§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Freeze for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> RefUnwindSafe for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Send for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Sync for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> Unpin for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> UnsafeUnpin for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

§

impl<const D0: usize, const D1: usize, const D2: usize, const D3: usize, const ELEM_BYTES: usize> UnwindSafe for Tensor4Shape<D0, D1, D2, D3, ELEM_BYTES>

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<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<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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.