-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Description
In proposal Add support for operations needed for well-known transformers , the validation steps of indices operand are defined as:
- Let axis be options.axis.
- Let axisSize be input.[[descriptor]].dimensions[axis]
- For each index → value of indices:
i. If index is greater than or equal to axisSize, then throw a "DataError" DOMException.
The index value of indices operand may not be available at the graph build time, e.g., when indices is an input operand or an intermediate operand produced by another operator. It should define the run-time behavior if the index value of indices is greater than or equal to axisSize.
In that proposal, @wacky6 also recommended to add a "implementation consideration" (i.e. an informative section) mentioning how out-of-bound indices should be handled by browser vendor and platform implementation with some bullet points:
- Runtime out-of-bounds indices should be explicitly handled by either the browser implementation or the platform implementation, to avoid OOB memory accesses.
- If the platform implementation doesn't handle out-of-bounds indices, the browser implementation should take steps to ensure the platform operator doesn't receive out-of-bound indices
- Mention what caller should expect as a result of list item 2: 0, NaN, first/last indices (if implemented with clamp)
/cc @anssiko @wchao1115 @fdwr
Reactions are currently unavailable