law sum_dims_drops

bendtorch-core@0.1.0.0 · src/autograd/sum_dims_LAWS.bend:163

import bendtorch-core@0.1.0.0/src/autograd/sum_dims_LAWS.bend as SumDimsLAWS
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/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/autograd/sum_dims.bend as SumDims

163# Without keepdim, it is the keepdim sum reshaped to the dropped dimensions.
164law sum_dims_drops:
165  for input: Core.Dynamic
166  for +axes: List<&2, U32>
167  for +kept: Shape.Shape
168  for +dropped: List<&2, U32>
169  for planned: {SumDims.plan(Totality.dynamic_shape(input), axes) == Done{SumDims.Plan{kept, dropped}} : Result<&2, &2, SumDims.Error, SumDims.Plan>}
170  {SumDims.sum_dims(input, axes, False{}) == reshaped(dropped, SumDims.sum_dims(input, axes, True{})) :
171    Core.Dynamic & Result<&2, &1, SumDims.Error, Core.Dynamic>}

Uses (17)

Used by (0)

No other definition uses this definition.