def row_maxes

bendtorch-core@0.1.0.0 · src/autograd/loss.bend:161

import bendtorch-core@0.1.0.0/src/autograd/loss.bend as Loss
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix

161# The maximum of each row of [rows, columns] logits, a [rows, 1] tensor.
162# Each output cell walks its own row, so the cells are built in parallel,
163# forked by the work of a row as Matrix.splits forks a matmul. The input
164# comes back unchanged.
165def row_maxes(input: Core.Dynamic, +target: Shape.Shape, +columns: Nat) -> Core.Dynamic & Result<&2, &1, Core.Error, Core.Dynamic>:
166  max_allocated(input, target, columns, Core.new(target, 0.0))

Uses (8)

Used by (1)