def reshape_write
bendtorch-core@0.1.0.0 · src/tensor/reshape_contract.bend:193
import bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend as ReshapeContract
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/transform_records.bend as Laws
import bendtorch-core@0.1.0.0/src/tensor/write_contract.bend as Writes
193def reshape_write(+input: Shape.Shape, +fill: F32, +target: Shape.Shape, +index: U32, +value: F32,
194 inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(input))) == True{} : Bool}, same: {Shape.logical_numel(Shape.dimensions(input)) == Shape.logical_numel(Shape.dimensions(target)) : Nat}) -> Laws.ReshapeWrite<input, fill, target, index, value>:
195 +inside = inside
196 +same = same
197 Laws.ReshapeWrite{
198 reshape_written(input, fill, target, index, value, index, value, same, target_inside(input, target, index, same, inside),
199 Writes.pick_hit(input, index, value, fill, inside)),
200 other => inside_other => different =>
201 reshape_written(input, fill, target, index, value, other, fill, same, inside_other,
202 Writes.pick_frame(input, index, value, other, fill, inside, different))}