def psmc
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
1377# softmax in place over the n numbers of p from off (n >= 1), as PyTorch: exp(x - max) / sum; with the count of the
1378# numbers it divided (the law causal reads it)
1379def psmc(+n: Nat, +off: U32, p: Array<F32>) -> PC:
1380 psm2(Nat.sub(n, 1n), off, pmax0(Nat.sub(n, 1n), off, Array.get(F32, p, off)))