def parallel_allocated
bendtorch-core@0.1.0.0 · src/tensor/elementwise.bend:479
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
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
479def parallel_allocated(+operation: Operation, +plan: Shape.BroadcastPlan, left: Core.Dynamic, right: Core.Dynamic,
480 result: Result<&2, &1, Core.Error, Core.Tensor<Shape.output_shape(plan)>>) ->
481 (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>:
482 match result:
483 case Fail{error}:
484 ((left, right), Fail{error})
485 case Done{Core.TTensor{storage, exact}}:
486 match storage:
487 case Storage.Empty{}:
488 ((left, right), Done{Core.pack(Shape.output_shape(plan), Core.TTensor{Storage.Empty{}, exact})})
489 case Storage.Owned{+depth, +length, array, balanced, valid}:
490 parallel_output(operation, plan, depth, length, valid, exact, take(left), take(right))