Skip to main content

LayerwiseTraversalRuntime

Enum LayerwiseTraversalRuntime 

Source
pub enum LayerwiseTraversalRuntime<Direct, Partitioned> {
    Direct(Direct),
    Partitioned(Partitioned),
}
Expand description

Neutral choice between an ordinary local traversal and the same traversal installed in a selected partition runtime.

Concrete backends construct one of these alternatives but do not retain a parallel execution enum or select a separate forward implementation.

Variants§

§

Direct(Direct)

Replicated local traversal.

§

Partitioned(Partitioned)

Architecture-selected partition traversal.

Implementations§

Source§

impl<Direct, Partitioned> LayerwiseTraversalRuntime<Direct, Partitioned>

Source

pub const fn direct(runtime: Direct) -> Self

Wraps an ordinary local layered runtime.

Source

pub const fn partitioned(runtime: Partitioned) -> Self

Wraps an architecture-selected partition runtime.

Source§

impl<A, B, S, ExecutionPolicy, G, R, I, T, U, V> LayerwiseTraversalRuntime<LayerwiseRuntime<A, B, S, ExecutionPolicy>, Box<PartitionedTextRuntime<A, B, S, (), LayerwiseTraversalPartitionExecutor<A, B, S, ExecutionPolicy>, G, R, I, T, U, V>>>

Source

pub fn forward_with_traversal_hook<'a, H>( &mut self, input: A::Input<'a>, state: &mut S, context: &<B::Tensor as Tensor>::Context, hook: &mut H, ) -> PartitionedTraversalResult<B::Tensor, A::ForwardContext, A::Error, ExecutionPolicy::Error>

Runs the selected local traversal without exposing its realization kind to concrete composition.

Source

pub fn policy(&self) -> &ExecutionPolicy

Borrows the selected residency policy independently of realization kind.

Source

pub fn architecture(&self) -> &A

Borrows the selected local architecture independently of realization kind.

Auto Trait Implementations§

§

impl<Direct, Partitioned> Freeze for LayerwiseTraversalRuntime<Direct, Partitioned>
where Direct: Freeze, Partitioned: Freeze,

§

impl<Direct, Partitioned> RefUnwindSafe for LayerwiseTraversalRuntime<Direct, Partitioned>
where Direct: RefUnwindSafe, Partitioned: RefUnwindSafe,

§

impl<Direct, Partitioned> Send for LayerwiseTraversalRuntime<Direct, Partitioned>
where Direct: Send, Partitioned: Send,

§

impl<Direct, Partitioned> Sync for LayerwiseTraversalRuntime<Direct, Partitioned>
where Direct: Sync, Partitioned: Sync,

§

impl<Direct, Partitioned> Unpin for LayerwiseTraversalRuntime<Direct, Partitioned>
where Direct: Unpin, Partitioned: Unpin,

§

impl<Direct, Partitioned> UnsafeUnpin for LayerwiseTraversalRuntime<Direct, Partitioned>
where Direct: UnsafeUnpin, Partitioned: UnsafeUnpin,

§

impl<Direct, Partitioned> UnwindSafe for LayerwiseTraversalRuntime<Direct, Partitioned>
where Direct: UnwindSafe, Partitioned: 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, !>

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.