def binary_mapping

bendtorch-core@0.1.0.0 · src/tensor/elementwise_parallel_proof.bend:561

import bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend as ElementwiseParallelProof
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/shape/plan_proofs.bend as PlanProof
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

561# The parallel `binary` meets the same `BinaryModel` as the sequential loop.
562def binary_mapping(+operation: Elementwise.Operation, left: Core.Dynamic, right: Core.Dynamic) ->
563  Elementwise.BinaryModel<operation, left, right, Elementwise.binary(operation, left, right)>:
564  Core.Packed{+left_shape, left_tensor} = left
565  Core.Packed{+right_shape, right_tensor} = right
566  planned_mapping(operation, left_shape, right_shape, Shape.broadcast_checked(left_shape, right_shape), left_tensor, right_tensor, {==},
567    PlanProof.broadcast_checked_plan(left_shape, right_shape))

Uses (7)

Used by (1)