Mojo struct
ScatterOobIndexStrategy
struct ScatterOobIndexStrategy
Valid indices are within the range [-dim_size, dim_size). Indices which fall outside of that can be handled using different strategies. Note that negative indices are allowed in order to support negative relative indexing. Eg: x[-1] == x[dim_size - 1].
Implemented traitsβ
AnyType,
Copyable,
Equatable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
Writable
comptime membersβ
SKIPβ
comptime SKIP = ScatterOobIndexStrategy(SIMD(1))
Users may pass in indices outside of the range [-dim_size, dim_size). In which case the corresponding update will be skipped.
UNDEFINEDβ
comptime UNDEFINED = ScatterOobIndexStrategy(SIMD(0))
Users must not pass in invalid indices. If passed, the scatter method may raise an error or return undefined results. Today, the scatter_nd kernel uses _unsafe_normalize_neg_index which will render the output contents invalid.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!