def checked_update_frame

bendtorch-core@0.1.0.0 · src/tensor/transform_PROOF.bend:491

import bendtorch-core@0.1.0.0/src/tensor/transform_PROOF.bend as TransformPROOF
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

491def checked_update_frame(-shape: Shape.Shape, -original: Core.Tensor<shape>, -output: Core.Tensor<shape>, -index: U32,
492  -value: F32, -unit: Unit, meaning: Core.CheckedUpdateMeaning(shape, original, index, value, (output, Done{unit}))) ->
493  @+other: U32 -> @checked: Core.ObservationChecked(Core.Packed{shape, original}, other) ->
494    @different: {Nat.is_eq(U32.to_nat(index), U32.to_nat(other)) == False{} : Bool} ->
495      Core.ObservationChecked(Core.Packed{shape, output}, other) &
496        {Core.checked_observe(shape, output, other) == Core.checked_observe(shape, original, other) : Maybe<&2, F32>}:
497  (checked, rest) = meaning
498  (observed, frame) = rest
499  frame

Uses (16)

Used by (1)