# tf.raw_ops.SoftmaxCrossEntropyWithLogits

<br />

Computes softmax cross entropy cost and gradients to backpropagate.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.raw_ops.SoftmaxCrossEntropyWithLogits`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/SoftmaxCrossEntropyWithLogits)

<br />

    tf.raw_ops.SoftmaxCrossEntropyWithLogits(
        features, labels, name=None
    )

Inputs are the logits, not probabilities.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `features` | A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`. batch_size x num_classes matrix |
| `labels` | A `Tensor`. Must have the same type as `features`. batch_size x num_classes matrix The caller must ensure that each batch of labels represents a valid probability distribution. |
| `name` | A name for the operation (optional). |

<br />

<br />

| ## Returns ||
|---|---|
| A tuple of `Tensor` objects (loss, backprop). ||
| `loss` | A `Tensor`. Has the same type as `features`. |
| `backprop` | A `Tensor`. Has the same type as `features`. |

<br />