Skip to main content

SequentialDecisionTraversal

Struct SequentialDecisionTraversal 

Source
pub struct SequentialDecisionTraversal<'a, B, S, D, C, E>
where B: SamplingBackend, S: Sampler<B>, D: SequentialDecisionBoundary<B, C, E>,
{ /* private fields */ }
Expand description

Adapter that drives sequential decisions from shared layered traversal hooks.

Implementations§

Source§

impl<'a, B, S, D, C, E> SequentialDecisionTraversal<'a, B, S, D, C, E>
where B: SamplingBackend, S: Sampler<B>, D: SequentialDecisionBoundary<B, C, E>,

Source

pub fn new( driver: &'a mut SequentialDecisionDriver<B, S>, boundary: &'a mut D, ) -> Self

Couples a decision driver to one architecture-owned boundary mapping.

Trait Implementations§

Source§

impl<NB, B, S, D, C, E> LayeredTraversalHook<NB, C, E> for SequentialDecisionTraversal<'_, B, S, D, C, E>
where NB: NeuralBackend, B: SamplingBackend<Logits = NB::Tensor, Context = <NB::Tensor as Tensor>::Context>, S: Sampler<B>, D: SequentialDecisionBoundary<B, C, E>,

Source§

fn before_unit( &mut self, group: usize, index: usize, remaining_units: usize, _value: &NB::Tensor, forward: &mut C, context: &<NB::Tensor as Tensor>::Context, ) -> Result<LayeredUnitAction, E>

Chooses whether to execute the next unit.
Source§

fn after_unit( &mut self, group: usize, index: usize, value: &NB::Tensor, forward: &mut C, context: &<NB::Tensor as Tensor>::Context, ) -> Result<(), E>

Observes one executed unit output.
Source§

fn after_group( &mut self, group: usize, value: &NB::Tensor, forward: &mut C, context: &<NB::Tensor as Tensor>::Context, ) -> Result<(), E>

Observes one completed execution-group output.

Auto Trait Implementations§

§

impl<'a, B, S, D, C, E> !UnwindSafe for SequentialDecisionTraversal<'a, B, S, D, C, E>

§

impl<'a, B, S, D, C, E> Freeze for SequentialDecisionTraversal<'a, B, S, D, C, E>

§

impl<'a, B, S, D, C, E> RefUnwindSafe for SequentialDecisionTraversal<'a, B, S, D, C, E>

§

impl<'a, B, S, D, C, E> Send for SequentialDecisionTraversal<'a, B, S, D, C, E>
where &'a mut SequentialDecisionDriver<B, S>: Send, &'a mut D: Send, PhantomData<fn(C) -> E>: Send,

§

impl<'a, B, S, D, C, E> Sync for SequentialDecisionTraversal<'a, B, S, D, C, E>
where &'a mut SequentialDecisionDriver<B, S>: Sync, &'a mut D: Sync, PhantomData<fn(C) -> E>: Sync,

§

impl<'a, B, S, D, C, E> Unpin for SequentialDecisionTraversal<'a, B, S, D, C, E>
where &'a mut SequentialDecisionDriver<B, S>: Unpin, &'a mut D: Unpin, PhantomData<fn(C) -> E>: Unpin,

§

impl<'a, B, S, D, C, E> UnsafeUnpin for SequentialDecisionTraversal<'a, B, S, D, C, E>

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.