def wrap_each
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signedimport Base
49# Each coordinate wrapped among its own axis's extent. A coordinate past the
50# rank has no extent and is wrapped among 0: the read refuses the coordinate
51# count before any range.
52def wrap_each(dimensions: List<&2, U32>, positions: List<&2, Position>) -> List<&2, U32>:
53 match dimensions positions:
54 case Nil{} positions:
55 wrap_all(0, positions)
56 case extent <> rest Nil{}:
57 Nil{}
58 case extent <> rest head <> tail:
59 wrap(extent, head) <> wrap_each(rest, tail)
Uses (5)
Used by (7)
- bendtorch-core@0.1.0.0/src/tensor/signed:read_coordinate
- bendtorch-core@0.1.0.0/src/tensor/signed:write_coordinate
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_read_coordinate_wraps
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_wrap_each_end
- bendtorch-core@0.1.0.0/src/tensor/signed_LAWS:signed_wrap_each_past_rank
- …