def reduce_to
import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduceimport 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
305# The contribution owner comes back unchanged next to the result. A target
306# that does not broadcast with the contribution fails with the planner's
307# broadcast error; a target whose broadcast with the contribution is larger
308# than the contribution (for example [2, 3] for a [3] contribution) fails with
309# NotReducible.
310def reduce_to(input: Core.Dynamic, +target: Shape.Shape) -> Core.Dynamic & Result<&2, &1, Error, Core.Dynamic>:
311 Core.Packed{+shape, tensor} = input
312 planned(shape, tensor, target, Shape.broadcast_checked(target, shape))
Uses (7)
Used by (16)
- bendtorch-core@0.1.0.0/src/autograd/sum_to_size:decided
- bendtorch-core@0.1.0.0/src/autograd/reduce_to_fold_PROOF:run_lift
- bendtorch-core@0.1.0.0/src/autograd/sum_dims:sum_planned
- bendtorch-core@0.1.0.0/src/autograd/reduce:reduce_to_dimensions_result
- bendtorch-core@0.1.0.0/src/autograd/reduce_LAWS:reduce_retains_input
- …