def planned_dimensions

bendtorch-core@0.1.0.0 · src/tensor/elementwise_PROOF.bend:556

import bendtorch-core@0.1.0.0/src/tensor/elementwise_PROOF.bend as ElementwisePROOF
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.bend as Elementwise
import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as ShapeLaws

556def planned_dimensions(+operation: Elementwise.Operation, +left_shape: Shape.Shape, +right_shape: Shape.Shape, +output: List<&2, U32>,
557  result: Result<&2, &2, Shape.Error, Shape.BroadcastPlan>, left: Core.Tensor<left_shape>, right: Core.Tensor<right_shape>,
558  -sources: {ShapeLaws.planned_dimensions(left_shape, right_shape, result) == (Shape.dimensions(left_shape), Shape.dimensions(right_shape)) : List<&2, U32> & List<&2, U32>},
559  -alignment: Shape.Broadcast<Shape.extents(left_shape), Shape.extents(right_shape), Shape.naturals(output)>) ->
560  Totality.DimensionsModel<output, Elementwise.parallel_planned(operation, Core.Packed{left_shape, left}, Core.Packed{right_shape, right}, result)>:
561  match result:
562    case Fail{error}:
563      Totality.DimensionsModel{Unit{}}
564    case Done{+plan}:
565      dimensions_reify(output, Elementwise.parallel_allocated(operation, plan, Core.Packed{left_shape, left}, Core.Packed{right_shape, right}, Core.new(Shape.output_shape(plan), 0.0)),
566        %planned_output_dimensions(left_shape, right_shape, plan, output, alignment, sources) :
567          Totality.DimensionsModel<_, Elementwise.parallel_allocated(operation, plan, Core.Packed{left_shape, left}, Core.Packed{right_shape, right}, Core.new(Shape.output_shape(plan), 0.0))>
568        parallel_allocated_dimensions(operation, plan, Core.Packed{left_shape, left}, Core.Packed{right_shape, right}, Core.new(Shape.output_shape(plan), 0.0)))

Uses (25)

Used by (1)