Skip to main content

ResidentUnitWindow

Struct ResidentUnitWindow 

Source
pub struct ResidentUnitWindow<U> { /* private fields */ }
Expand description

Minimal one-at-a-time unit window useful for conformance and resident storage.

Implementations§

Source§

impl<U> ResidentUnitWindow<U>

Source

pub fn new(units: Vec<U>) -> Self

Creates a window over an ordered set of already populated units.

Trait Implementations§

Source§

impl<B, U> LayerwisePolicy<B, U> for ResidentUnitWindow<U>
where B: NeuralBackend,

Source§

type Lease = ResidentUnitLease<U>

Concrete lease owning one populated unit and all residency guards.
Source§

type Error = ResidentUnitWindowError

Concrete acquisition or completion failure.
Source§

fn begin( &mut self, _initial: &B::Tensor, _context: &<B::Tensor as Tensor>::Context, ) -> Result<(), Self::Error>

Starts one forward after architecture input preparation.
Source§

fn abort( &mut self, active: Option<(usize, ExecutionUnitAddress, Self::Lease)>, _context: &<B::Tensor as Tensor>::Context, )

Aborts an incomplete forward and releases all policy-owned state. Read more
Source§

fn acquire<E, F>( &mut self, index: usize, _address: ExecutionUnitAddress, _build: F, _context: &<B::Tensor as Tensor>::Context, ) -> Result<Self::Lease, LayerwiseAcquireError<E, Self::Error>>
where F: FnOnce(&<B::Tensor as Tensor>::Context) -> Result<U, E>,

Acquires one populated unit for exclusive execution. Read more
Source§

fn complete<'a, StateValues, ContextValues>( &mut self, index: usize, _address: ExecutionUnitAddress, lease: Self::Lease, _output: &'a B::Tensor, _state_values: StateValues, _context_values: ContextValues, _context: &<B::Tensor as Tensor>::Context, ) -> Result<(), Self::Error>
where B::Tensor: 'a, StateValues: Iterator<Item = &'a B::Tensor>, ContextValues: Iterator<Item = &'a B::Tensor>,

Retains the unit and dependent native values through exact completion.
Source§

fn finish( &mut self, _output: &B::Tensor, _context: &<B::Tensor as Tensor>::Context, ) -> Result<(), Self::Error>

Completes the final output and releases any remaining unit guards.

Auto Trait Implementations§

§

impl<U> Freeze for ResidentUnitWindow<U>
where Vec<Option<U>>: Freeze,

§

impl<U> RefUnwindSafe for ResidentUnitWindow<U>

§

impl<U> Send for ResidentUnitWindow<U>
where Vec<Option<U>>: Send,

§

impl<U> Sync for ResidentUnitWindow<U>
where Vec<Option<U>>: Sync,

§

impl<U> Unpin for ResidentUnitWindow<U>
where Vec<Option<U>>: Unpin,

§

impl<U> UnsafeUnpin for ResidentUnitWindow<U>
where Vec<Option<U>>: UnsafeUnpin,

§

impl<U> UnwindSafe for ResidentUnitWindow<U>
where Vec<Option<U>>: UnwindSafe,

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> 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> Same for T

Source§

type Output = T

Should always be Self
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, <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.