def reduced

bendtorch-core@0.1.0.0 · src/autograd/tensor_vjp_LAWS.bend:35

import bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend as TensorVjpLAWS
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/autograd/sum_to_size_fold_LAWS.bend as SumToSizeFold

35# What sum_to_size(contribution, target) holds at target cell index, for a
36# contribution of `shape` whose words are `values`: the word itself when the
37# target has the contribution's dimensions, the ordered fiber sum otherwise.
38def reduced(+target: Shape.Shape, +shape: Shape.Shape, +plan: Shape.BroadcastPlan, +values: List<&2, F32>, +index: U32) ->
39  Maybe<&2, F32>:
40  SumToSizeFold.summed(Layout.words_same(Shape.dimensions(shape), Shape.dimensions(target)), plan,
41    Shape.logical_numel(Shape.dimensions(shape)), values, index)

Uses (10)

Used by (6)