def max_cell
bendtorch-core@0.1.0.0 · src/autograd/loss.bend:117
import bendtorch-core@0.1.0.0/src/autograd/loss.bend as Loss
import Base
import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduce
117
118
119
120def max_cell(+width: Width, +position: Nat, state: Array<F32> & Unit, inside: Bool) -> F32 & (Array<F32> & Unit):
121 Width{+columns} = width
122 (array, none) = state
123 match inside:
124 case False{}:
125 (0.0, (array, none))
126 case True{}:
127 Reduce.keep(row_max(columns, position, array), none)