Skip to main content

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?