law gather_out_of_range
import bendtorch-core@0.1.0.0/src/tensor/gather_LAWS.bend as GatherLAWSimport Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed
import bendtorch-core@0.1.0.0/src/tensor/gather.bend as Gather
161law gather_out_of_range:
162 for +input: Shape.Shape
163 for +dim: Signed.Position
164 for +index: Shape.Shape
165 for +entries: List<&2, U32>
166 for counted: {Nat.is_eq(length(entries), Shape.elements(index)) == True{} : Bool}
167 for in_rank: {Nat.is_lt(axis(input, dim), rank(input)) == True{} : Bool}
168 for ranked: {Nat.is_eq(Shape.rank_dimensions(Shape.dimensions(index)), rank(input)) == True{} : Bool}
169 for matched: {others(Shape.dimensions(input), Shape.dimensions(index), axis(input, dim)) == True{} : Bool}
170 for past: {inside(entries, extent(input, axis(input, dim))) == False{} : Bool}
171 {Gather.gather_plan(input, dim, Gather.Index{index, entries}) == Fail{Gather.OutOfRange{}} :
172 Result<&2, &2, Gather.Error, Gather.Planned>}
Uses (32)
Used by (0)
No other definition uses this definition.