Skip to main content

burn_train/evaluator/
components.rs

1use crate::InferenceStep;
2use burn_core::module::Module;
3use std::marker::PhantomData;
4
5/// All components necessary to evaluate a model grouped in one trait.
6pub trait EvaluatorComponentTypes {
7    /// The model to evaluate.
8    type Model: Module + InferenceStep + core::fmt::Display + 'static;
9}
10
11/// A marker type used to provide [evaluation components](EvaluatorComponentTypes).
12pub struct EvaluatorComponentTypesMarker<M> {
13    _p: PhantomData<M>,
14}
15
16impl<M> EvaluatorComponentTypes for EvaluatorComponentTypesMarker<M>
17where
18    M: Module + InferenceStep + core::fmt::Display + 'static,
19{
20    type Model = M;
21}