def sum_planned

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

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/core.bend as Core
import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduce

135# The sum of a planned input: reduce_to onto the kept shape, then, without
136# keepdim, the reshape to the dropped dimensions. The input owner comes back.
137def sum_planned(input: Core.Dynamic, plan: Plan, keepdim: Bool) -> Core.Dynamic & Result<&2, &1, Error, Core.Dynamic>:
138  Plan{+kept, +dropped} = plan
139  summed(dropped, keepdim, Reduce.reduce_to(input, kept))

Uses (8)

Used by (2)