def ce_picked
bendtorch-core@0.1.0.0 · src/autograd/loss.bend:314
import bendtorch-core@0.1.0.0/src/autograd/loss.bend as Loss
import Base
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/reduction.bend as Reduction
314def ce_picked(+rows: Nat, pair: (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>) -> Result<&2, &1, Error, Recorded>:
315 (operands, result) = pair
316 (lp, onehot) = operands
317 match result:
318 case Fail{error}:
319 Fail{TensorError{error}}
320 case Done{picked}:
321 ce_total(rows, lp, onehot, Reduction.sum_dynamic(picked))