computeForBatch

fun <T : DType, V> Metric.computeForBatch(predictions: Tensor<T, V>, targets: Tensor<out DType, *>, ctx: ExecutionContext): Double(source)

Convenience function to compute a metric for a single batch without accumulation. Returns the metric value directly.