pub fn kl_divergence_batchmean(
student_logits: &Tensor,
teacher_logits: &Tensor,
) -> Result<Tensor>Expand description
Compute F.kl_div(F.log_softmax(student, -1), F.softmax(teacher, -1), reduction="batchmean")
in F32 for numerical stability.
ยงErrors
Returns an error if shapes mismatch or tensor ops fail.