use crate::metric::{ItemLazy, processor::EventProcessorEvaluation};
use burn_core::{module::Module, prelude::Backend};
use std::marker::PhantomData;
pub trait EvaluatorComponentTypes {
type Backend: Backend;
type Model: Module<Self::Backend>
+ TestStep<Self::TestInput, Self::TestOutput>
+ core::fmt::Display
+ 'static;
type EventProcessor: EventProcessorEvaluation<ItemTest = Self::TestOutput> + 'static;
type TestInput: Send + 'static;
type TestOutput: ItemLazy + 'static;
}
pub trait TestStep<TI, TO> {
fn step(&self, item: TI) -> TO;
}
pub struct EvaluatorComponentTypesMarker<B, M, E, TI, TO> {
_p: PhantomData<(B, M, E, TI, TO)>,
}
impl<B, M, E, TI, TO> EvaluatorComponentTypes for EvaluatorComponentTypesMarker<B, M, E, TI, TO>
where
B: Backend,
M: Module<B> + TestStep<TI, TO> + core::fmt::Display + 'static,
E: EventProcessorEvaluation<ItemTest = TO> + 'static,
TI: Send + 'static,
TO: ItemLazy + 'static,
{
type Backend = B;
type Model = M;
type EventProcessor = E;
type TestInput = TI;
type TestOutput = TO;
}