latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.nn.functional.kl_div
- tensorplay.nn.functional.kl_div(input: Tensor, target: Tensor, size_average=None, reduce=None, reduction: str = 'mean', log_target: bool = False) Tensor[source]
Compute the KL Divergence loss.
inputholds log-probabilities; seeKLDivLoss. Note thatreduction='mean'divides by the number of elements and does not return the true KL divergence value — use'batchmean'.
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

