def planned

bendtorch-core@0.1.0.0 · src/autograd/reduce.bend:296

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

296def planned(+shape: Shape.Shape, tensor: Core.Tensor<shape>, +target: Shape.Shape,
297  result: Result<&2, &2, Shape.Error, Shape.BroadcastPlan>) -> Core.Dynamic & Result<&2, &1, Error, Core.Dynamic>:
298  match result:
299    case Fail{error}:
300      (Core.Packed{shape, tensor}, Fail{TensorError{Core.ShapeError{error}}})
301    case Done{+plan}:
302      fitted(Core.Packed{shape, tensor}, target, plan,
303        Layout.words_same(Shape.dimensions(Shape.output_shape(plan)), Shape.dimensions(shape)))

Uses (14)

Used by (9)