use super::weight::Weight;
#[derive(Debug)]
pub struct CtcState<T> {
pub(super) shape: [usize; 3],
pub(super) loss: T,
pub(super) batch_divisor: T,
pub(super) alpha: Vec<Weight<T>>,
pub(super) beta: Vec<Weight<T>>,
pub(super) labels: Vec<usize>,
pub(super) samples: Vec<Sample<T>>,
}
#[derive(Debug)]
pub(super) struct Sample<T> {
pub(super) frames: usize,
pub(super) states: usize,
pub(super) offset: usize,
pub(super) labels_offset: usize,
pub(super) log_likelihood: Weight<T>,
pub(super) target_divisor: T,
}
impl<T: Copy> CtcState<T> {
#[must_use]
pub fn loss(&self) -> T {
self.loss
}
}