law flatten_rank_error

bendtorch-core@0.1.0.0 · src/shape/LAWS.bend:221

import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as LAWS
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape

221# A coordinate whose rank differs from the shape's fails with
222# CoordinateRankMismatch, checked before any bound: [9] on [2, 3] is a rank
223# error, not an out-of-bounds error.
224law flatten_rank_error:
225  for +shape: Shape.Shape
226  for +values: List<&2, U32>
227  for differ: {Shape.rank_dimensions(Shape.dimensions(shape)) != Shape.rank_dimensions(values) : Nat}
228  {Shape.flatten_checked(shape, values) == Fail{Shape.CoordinateRankMismatch{}} : Result<&2, &2, Shape.Error, Shape.FlatIndex<shape>>}

Uses (14)

Used by (0)

No other definition uses this definition.