law mapping_index_rejection

bendtorch-core@0.1.0.0 · src/tensor/transform_LAWS.bend:379

import bendtorch-core@0.1.0.0/src/tensor/transform_LAWS.bend as TransformLAWS
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout

379law mapping_index_rejection:
380  for +input: Shape.Shape
381  for +axes: List<&2, U32>
382  for +plan: Layout.Plan<input, axes>
383  for +index: U32
384  for +outside: {False{} == U32.is_lt(index, Shape.count(Layout.output(input, axes, plan))) : Bool}
385  {Layout.map_index(input, axes, plan, index) == Fail{Layout.ShapeError{Shape.FlatIndexOutOfBounds{}}} :
386    Result<&2, &2, Layout.Error, Layout.Mapping<input, axes, plan, index>>}

Uses (15)

Used by (0)

No other definition uses this definition.