For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Python function
find_contiguous_ranges
find_contiguous_ranges()β
max.support.image.find_contiguous_ranges(arr, targets)
Find the contiguous ranges of the given tokens in a 1D array.
For example:
find_contiguous_ranges([1, 2, 99, 99, 3, 99, 98, 99], [98, 99])-
Parameters:
-
Returns:
-
A list of
(start, end)half-open ranges[start, end), one per maximal run of positions wherearrholds a value intargets. -
Raises:
-
ValueError β If
arris not 1D. -
Return type:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!