---
title: "scatter(updates:indices:mode:axis:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/bnnsgraph/builder/tensor/scatter(updates:indices:mode:axis:)"
---

# scatter(updates:indices:mode:axis:)

Adds a scatter operation to the current graph.

## Declaration

```swift
func scatter(updates: BNNSGraph.Builder.Tensor<T>, indices: some BNNSGraph.Builder.OperationParameter<Int32>, mode: BNNSGraph.Builder.ScatterMode, axis: Int) -> BNNSGraph.Builder.Tensor<T>
```

## Parameters

- `updates`: A tensor that specifes the values that the operation scatters.
- `indices`: The indices that the operation scatters.
- `mode`: An enumeration that specifies how the operation calculates scattered values.
- `axis`: The axis over which the operation scatters.
