Skip to content
class

ClassLossForwardResult

ClassLossForwardResult

Aggregated return value from classification-loss forward passes.

Used by IBackend::cross_entropy_loss and IBackend::nll_loss to ship the forward output together with the saved tensors the corresponding backward pass needs.

See Also

IBackend::cross_entropy_backward — consumer.

Attributes

outputStorage
Scalar (reduction != 0) or per-sample (reduction == 0) loss.
saved_auxStorage
Intermediate values needed by the backward pass — e.g. the log-softmax activations for cross-entropy.
valid_countStorage
Scalar I64 count of un-ignored samples; consumed by mean reduction so that ignore_index entries are excluded from the denominator.