law gather_planned

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

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/slice.bend as Slice
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

174law gather_planned:
175  for +input: Shape.Shape
176  for +dim: Signed.Position
177  for +index: Shape.Shape
178  for +entries: List<&2, U32>
179  for counted: {Nat.is_eq(length(entries), Shape.elements(index)) == True{} : Bool}
180  for in_rank: {Nat.is_lt(axis(input, dim), rank(input)) == True{} : Bool}
181  for ranked: {Nat.is_eq(Shape.rank_dimensions(Shape.dimensions(index)), rank(input)) == True{} : Bool}
182  for matched: {others(Shape.dimensions(input), Shape.dimensions(index), axis(input, dim)) == True{} : Bool}
183  for within: {inside(entries, extent(input, axis(input, dim))) == True{} : Bool}
184  {Gather.gather_plan(input, dim, Gather.Index{index, entries}) ==
185    taken(Gather.Gathered{}, Shape.dimensions(input), axis(input, dim), Slice.axis_extent(Shape.dimensions(index), axis(input, dim))) :
186    Result<&2, &2, Gather.Error, Gather.Planned>}

Uses (34)

Used by (0)

No other definition uses this definition.