def write_owner_projection

bendtorch-core@0.1.0.0 · src/tensor/contracts/replayed.bend:128

import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
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/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle

128def write_owner_projection(-shape: Shape.Shape, -original: Storage.Storage,
129  -valid: {Lifecycle.logical_length(original) == Shape.logical_numel(Shape.dimensions(shape)) : Nat}, +index: U32, +word: F32,
130  pair: Storage.Storage & Result<&2, &2, Storage.Error, Unit>,
131  -same: {pair == Storage.set(original, index, word) : Storage.Storage & Result<&2, &2, Storage.Error, Unit>}) ->
132  {write_stored(shape, Core.write_result(shape, original, valid, index, word, pair, same)) ==
133    StorageLaws.owner(Result<&2, &2, Storage.Error, Unit>, pair) : Storage.Storage}:
134  (storage, result) = pair
135  {==}

Uses (17)

Used by (1)