#[derive(Debug, Clone)]
pub enum LossFunction {
CrossEntropy,
MSE,
MAE,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn loss_variants_debug() {
assert_eq!(format!("{:?}", LossFunction::CrossEntropy), "CrossEntropy");
assert_eq!(format!("{:?}", LossFunction::MSE), "MSE");
assert_eq!(format!("{:?}", LossFunction::MAE), "MAE");
}
#[test]
fn loss_clone() {
let loss = LossFunction::MSE;
#[expect(
clippy::redundant_clone,
reason = "clone needed for borrowck across async boundary"
)]
let cloned = loss.clone();
assert!(matches!(cloned, LossFunction::MSE));
}
}