def mismatch_built
bendtorch-core@0.1.0.0 · src/tensor/reshape_contract.bend:220
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/shape/LAWS.bend as ShapeLaws
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
220def mismatch_built(+input: Shape.Shape, +target: Shape.Shape, -tensor: Core.Tensor<input>,
221 built: Shape.ConstructResult<Shape.dimensions(target)>,
222 complete: {ShapeLaws.built(Shape.dimensions(target), built) == Some{Shape.dimensions(target)} : Maybe<&2, List<&2, U32>>},
223 different: {Nat.is_eq(Shape.logical_numel(Shape.dimensions(input)), Shape.logical_numel(Shape.dimensions(target))) == False{} : Bool}) ->
224 {Transforms.reshape_built(input, tensor, Shape.dimensions(target), built) == Fail{Transforms.LayoutError{Layout.ElementCountMismatch{}}} : Result<&2, &1, Transforms.Error, Core.Dynamic>}:
225 match built:
226 case Shape.SError{error}:
227 Empty.absurd({Transforms.reshape_built(input, tensor, Shape.dimensions(target), Shape.SError{error}) == Fail{Transforms.LayoutError{Layout.ElementCountMismatch{}}} : Result<&2, &1, Transforms.Error, Core.Dynamic>},
228 Arith.clash(Equal.cong(Maybe<&2, List<&2, U32>>, Bool, found => Maybe.is_some(&2, List<&2, U32>, found), None{}, Some{Shape.dimensions(target)}, complete)))
229 case Shape.SBuilt{+output, preserved}:
230 mismatch_decided(input, target, output, tensor, Shape.bool_case(Nat.is_eq(Shape.elements(input), Shape.elements(output))), preserved, different)