def write_outside
bendtorch-core@0.1.0.0 · src/tensor/write_contract.bend:202
import bendtorch-core@0.1.0.0/src/tensor/write_contract.bend as WriteContract
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/read_write_records.bend as Laws
import bendtorch-core@0.1.0.0/src/tensor/read_contract.bend as Reads
202def write_outside(+shape: Shape.Shape, +fill: F32, +index: U32, +value: F32,
203 outside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(shape))) == False{} : Bool}) -> Laws.WriteOutside<shape, fill, index, value>:
204 +outside = outside
205 Laws.WriteOutside{
206 write_contract(shape, fill, index, value, Fail{Storage.OutOfBounds{}},
207 StorageLaws.set_outside(StorageLaws.created(Shape.count(shape), fill), index, value, Reads.size_outside(shape, fill, index, outside))),
208 other => inside =>
209 written_value(shape, fill, index, value, other, fill, inside, pick_outside(shape, index, value, other, fill, outside))}