mask_to_index
¶
Converts a boolean mask to the indices of its True entries (the
inverse of index_to_mask()).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mask
|
array
|
A boolean array of shape |
required |
Returns:
| Type | Description |
|---|---|
array
|
The sorted int32 indices where |
Example:
Source code in mlx_graphs/utils/indexing.py
from mlx_graphs.utils import mask_to_index · mlx_graphs/utils/indexing.py