.. _l-onnx-doc-SparseSoftmaxCrossEntropy: ========================= SparseSoftmaxCrossEntropy ========================= .. contents:: :local: .. _l-onnx-op-sparsesoftmaxcrossentropy-9: SparseSoftmaxCrossEntropy - 9 ============================= **Version** * **name**: `SparseSoftmaxCrossEntropy (GitHub) `_ * **domain**: **main** * **since_version**: **9** * **function**: * **support_level**: * **shape inference**: This version of the operator has been available **since version 9**. **Summary** SparseSoftmaxCrossEntropy **Attributes** * **reduction**: Type of reduction to apply to loss: none, sum, mean(default). 'none': the output is the loss for each sample in the batch.'sum': the output will be summed. 'mean': the sum of the output will be divided by the batch_size. Default value is ``?``. **Inputs** Between 2 and 3 inputs. * **logits** (heterogeneous) - **T**: Unscaled log probabilities, (N+1)-D input of shape (-1, num_classes). * **label** (heterogeneous) - **Tind**: label is N-D input whose shape should match that of logits. It is a tensor of nonnegative integers, where each element is the nonnegative integer label for the element of the batch. * **weight** (optional, heterogeneous) - **T**: weight for each sample. The shape is the same as label's **Outputs** Between 1 and 2 outputs. * **Y** (heterogeneous) - **T**: loss. * **log_prob** (optional, heterogeneous) - **T**: logsoftmax(logits) **Examples**