Method
random_idx
(rows: int, cols: int, depths: int | None = None)
Source from the content-addressed store, hash-verified
| 191 | |
| 192 | @staticmethod |
| 193 | def random_idx(rows: int, cols: int, depths: int | None = None) -> np.ndarray: |
| 194 | idx: list[tuple] = [] |
| 195 | |
| 196 | for r in range(rows): |
| 197 | for c in range(cols): |
| 198 | if depths: |
| 199 | for d in range(depths): |
| 200 | idx.append((r, c, d)) |
| 201 | else: |
| 202 | idx.append((r, c)) |
| 203 | |
| 204 | idx_np = np.array(idx) |
| 205 | np.random.shuffle(idx_np) |
| 206 | |
| 207 | return idx_np |
Callers
nothing calls this directly
Tested by
no test coverage detected