def reduces

bendtorch-core@0.1.0.0 · src/autograd/sum_dims.bend:29

import bendtorch-core@0.1.0.0/src/autograd/sum_dims.bend as SumDims
import Base
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout

29# Whether the sum reduces axis `axis`: every axis for an empty list.
30def reduces(+axes: List<&2, U32>, +axis: U32) -> Bool:
31  match axes:
32    case Nil{}:
33      True{}
34    case +head <> +tail:
35      Layout.contains(axis, head <> tail)

Uses (4)

Used by (7)