---
title: "nllLoss"
sidebar_label: "nllLoss"
description: "Kotlin binding reference: nllLoss."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[nllLoss](nllLoss.md)

# nllLoss

[common]\
fun [nllLoss](nllLoss.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null, ignoreIndex: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN): [Tensor](../Tensor/index.md)

`nllLoss(input: Tensor, target: Tensor, weight: Tensor? = null, ignoreIndex: Long? = null, reduction: Reduction = Reduction.MEAN)`: the `nll_loss` operator. Negative-log-likelihood loss over LOG-probabilities; class dim LAST. `input` is expected to already be log-probabilities (pair with `log_softmax`; `cross_entropy` is the fused form).