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

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

SKIP

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