def independent_pair_mapping

bendtorch-core@0.1.0.0 · src/tensor/core_PROOF.bend:1076

import bendtorch-core@0.1.0.0/src/tensor/core_PROOF.bend as CorePROOF
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/core_LAWS.bend as Laws
import bendtorch-core@0.1.0.0/src/tensor/projection_LAWS.bend as Projection

1076def independent_pair_mapping(+operation: Elementwise.Operation, +plan: Shape.BroadcastPlan, -left: Core.Dynamic, -right: Core.Dynamic,
1077  result: (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>,
1078  -shared: Elementwise.SuccessfulMapping(operation, plan, left, right, result)) -> Laws.IndependentModel<operation, plan, left, right, result>:
1079  (inputs, outcome) = result
1080  match outcome:
1081    case Fail{error}:
1082      Laws.IndependentModel{Unit{}}
1083    case Done{output}:
1084      Laws.IndependentModel{index => inside => Equal.trans(Maybe<&2, F32>, Core.observe_dynamic(output, index), Elementwise.expected(operation, plan, left, right, index),
1085        Projection.specified_expected(operation, left, right, Projection.offset_spec(plan, U32.to_nat(index))), shared(index)(inside),
1086        Projection.expected_projection_refines(operation, plan, left, right, index))}

Uses (19)

Used by (2)