Skip to main content

StagedSamplerHook

Trait StagedSamplerHook 

Source
pub trait StagedSamplerHook {
    type E: Env<Tensor: R2lTensor>;

    // Required method
    fn hook(
        &mut self,
        core: &mut StagedSamplerCore<Self::E>,
    ) -> SamplerHookResult;

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

Hook that controls the sequence of collection bounds for a staged sampler.

Required Associated Types§

Source

type E: Env<Tensor: R2lTensor>

Environment type sampled by the hook’s sampler.

Required Methods§

Source

fn hook(&mut self, core: &mut StagedSamplerCore<Self::E>) -> SamplerHookResult

Returns the next collection instruction.

Provided Methods§

Source

fn reset(&mut self)

Resets hook state before a new training or evaluation run.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§