def update_frame

bendtorch-core@0.1.0.0 · src/autograd/reduce_PROOF.bend:103

import bendtorch-core@0.1.0.0/src/autograd/reduce_PROOF.bend as ReducePROOF
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

103def update_frame(-shape: Shape.Shape, -original: Core.Tensor<shape>, -output: Core.Tensor<shape>, -index: U32, -value: F32, -unit: Unit,
104  meaning: Core.CheckedUpdateMeaning(shape, original, index, value, (output, Done{unit}))) ->
105  @+other: U32 -> @checked: Core.ObservationChecked(Core.Packed{shape, original}, other) ->
106    @different: {Nat.is_eq(U32.to_nat(index), U32.to_nat(other)) == False{} : Bool} ->
107      Core.ObservationChecked(Core.Packed{shape, output}, other) &
108        {Core.checked_observe(shape, output, other) == Core.checked_observe(shape, original, other) : Maybe<&2, F32>}:
109  (checked, rest) = meaning
110  (observed, frame) = rest
111  frame

Uses (16)

Used by (1)