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 function
scatter_nd
def scatter_nd[output_type: DType, indices_type: DType, //, target: StringSlice[ImmStaticOrigin] = StringSlice("cpu")](data: TileTensor[output_type, Storage=data.Storage, linear_idx_type=data.linear_idx_type], indices: TileTensor[indices_type, Storage=indices.Storage, linear_idx_type=indices.linear_idx_type], updates: TileTensor[output_type, Storage=updates.Storage, linear_idx_type=updates.linear_idx_type], output: TileTensor[output_type, Storage=output.Storage, linear_idx_type=output.linear_idx_type], context: DeviceContext)
Scatter_nd operation without any reduction.
Parameters:
- βoutput_type (
DType): Element type ofdata,updates, andoutput. - βindices_type (
DType): Element type of theindicestensor. - βtarget (
StringSlice[ImmStaticOrigin]): Target backend to execute on, such as "cpu" or "cuda".
Args:
- βdata (
TileTensor[output_type, Storage=data.Storage, linear_idx_type=data.linear_idx_type]): Source tensor of rank at least 1 copied intooutputbefore scattering. - βindices (
TileTensor[indices_type, Storage=indices.Storage, linear_idx_type=indices.linear_idx_type]): Tensor of indices addressing where to writeupdatesintooutput. - βupdates (
TileTensor[output_type, Storage=updates.Storage, linear_idx_type=updates.linear_idx_type]): Tensor of values to scatter intooutputat the positions given byindices. - βoutput (
TileTensor[output_type, Storage=output.Storage, linear_idx_type=output.linear_idx_type]): Output tensor, shaped the same asdata, holding the copied and scattered result. - βcontext (
DeviceContext): Device context for execution.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!