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# The cell function of the row-maximum build: cell `position` is the
118# maximum of row `position`. The state is the input array next to a Unit, as
119# in Reduce.build.
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)

Uses (10)

Used by (2)