def parallel_allocated_dimensions

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

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/storage/main.bend as Storage
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

543def parallel_allocated_dimensions(+operation: Elementwise.Operation, +plan: Shape.BroadcastPlan, left: Core.Dynamic, right: Core.Dynamic,
544  result: Result<&2, &1, Core.Error, Core.Tensor<Shape.output_shape(plan)>>) ->
545  Totality.DimensionsModel<Shape.dimensions(Shape.output_shape(plan)), Elementwise.parallel_allocated(operation, plan, left, right, result)>:
546  match result:
547    case Fail{error}:
548      Totality.DimensionsModel{Unit{}}
549    case Done{Core.TTensor{storage, exact}}:
550      match storage:
551        case Storage.Empty{}:
552          Totality.DimensionsModel{{==}}
553        case Storage.Owned{+depth, +length, array, balanced, valid}:
554          output_dimensions(operation, plan, depth, length, valid, exact, Elementwise.take(left), Elementwise.take(right))

Uses (14)

Used by (2)