ReshapeContract.reshape_contract: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend as ReshapeContract Lines 183-191 of bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend&start_line=183&end_line=191 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape 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 import bendtorch-core@0.1.0.0/src/tensor/transform_records.bend as Laws def reshape_contract(+input: Shape.Shape, +fill: F32, +target: Shape.Shape, same: {Shape.logical_numel(Shape.dimensions(input)) == Shape.logical_numel(Shape.dimensions(target)) : Nat}) -> Laws.ReshapeContract: +same = same Laws.ReshapeContract{ reshape_outcome(input, fill, target, same), reshape_dimensions(input, fill, target, same), reshape_length(input, fill, target, same), reshape_count(input, fill, target, same), other => inside => Reads.new_lift(input, fill, result => {Observation.reshape_value(input, Shape.dimensions(target), other, result) == Some{fill} : Maybe<&2, F32>}, valid => reshape_value_done(input, fill, target, valid, other, same, inside))} Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=logical_numel https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/read_contract.bend&name=new_lift https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend&name=reshape_count https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend&name=reshape_dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend&name=reshape_length https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend&name=reshape_outcome https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/reshape_contract.bend&name=reshape_value_done https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transform_observation.bend&name=reshape_value https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/transform_records.bend&name=ReshapeContract