# tensorplay.nn.functional.kl_div Source: https://www.tensorplay.cn/docs/generated/tensorplay.nn.functional.kl_div.html ```python tensorplay.nn.functional.kl_div(input: Tensor, target: Tensor, size_average=None, reduce=None, reduction: str = 'mean', log_target: bool = False) → Tensor ``` Compute the KL Divergence loss. input holds log-probabilities; see KLDivLoss. Note that reduction='mean' divides by the number of elements and does not return the true KL divergence value — use 'batchmean'.