def reshape_value_done
bendtorch-core@0.1.0.0 · src/tensor/reshape_contract.bend:133
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/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
import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
import bendtorch-core@0.1.0.0/src/tensor/word_conversion.bend as Conversion
import bendtorch-core@0.1.0.0/src/tensor/read_contract.bend as Reads
import bendtorch-core@0.1.0.0/src/tensor/transform_observation.bend as Observation
133def reshape_value_done(+input: Shape.Shape, +fill: F32, +target: Shape.Shape, -valid: {Lifecycle.logical_length(StorageLaws.created(Shape.count(input), fill)) == Shape.logical_numel(Shape.dimensions(input)) : Nat}, +other: U32, +same: {Shape.logical_numel(Shape.dimensions(input)) == Shape.logical_numel(Shape.dimensions(target)) : Nat}, inside: {Nat.is_lt(U32.to_nat(other), Shape.logical_numel(Shape.dimensions(target))) == True{} : Bool}) ->
134 {Observation.reshape_value(input, Shape.dimensions(target), other, Done{Core.TTensor{StorageLaws.created(Shape.count(input), fill), valid}}) == Some{fill} : Maybe<&2, F32>}:
135 Equal.trans(Maybe<&2, F32>, Observation.output_value(other, Transforms.reshape(input, Core.TTensor{StorageLaws.created(Shape.count(input), fill), valid}, Shape.dimensions(target))),
136 Lifecycle.read_value(Storage.get(StorageLaws.created(Shape.count(input), fill), other)), Some{fill},
137 reshaped_value(input, target, StorageLaws.created(Shape.count(input), fill), valid, other, same),
138 Reads.stored_value(StorageLaws.created(Shape.count(input), fill), other, fill,
139 StorageLaws.replay_get(Shape.count(input), fill, [], other, Conversion.shape_count_within(input),
140 Reads.word_inside(input, other, inside_input(input, target, other, same, inside)))))