law gather_rank_refused

bendtorch-core@0.1.0.0 · src/tensor/gather_LAWS.bend:138

import bendtorch-core@0.1.0.0/src/tensor/gather_LAWS.bend as GatherLAWS
import 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

138law gather_rank_refused:
139  for +input: Shape.Shape
140  for +dim: Signed.Position
141  for +index: Shape.Shape
142  for +entries: List<&2, U32>
143  for counted: {Nat.is_eq(length(entries), Shape.elements(index)) == True{} : Bool}
144  for in_rank: {Nat.is_lt(axis(input, dim), rank(input)) == True{} : Bool}
145  for ranked: {Nat.is_eq(Shape.rank_dimensions(Shape.dimensions(index)), rank(input)) == False{} : Bool}
146  {Gather.gather_plan(input, dim, Gather.Index{index, entries}) == Fail{Gather.IndexRankMismatch{}} :
147    Result<&2, &2, Gather.Error, Gather.Planned>}

Uses (23)

Used by (0)

No other definition uses this definition.