IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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).

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, ImplicitlyDeletable, Movable, Writable

comptime members​

SKIP​

comptime SKIP = ScatterOobIndexStrategy(Int32(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(Int32(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.