scatter(withDimension:source:indices:copyFrom:reductionType:)
Adds a scatter layer to the graph.
Declaration
func scatter(withDimension dimension: Int, source: MLCTensor, indices: MLCTensor, copyFrom: MLCTensor, reductionType: MLCReductionType) -> MLCTensor?Parameters
- dimension:
The dimension along which to index.
- source:
The source tensor.
- indices:
The index of elements to scatter.
- copyFrom:
The source tensor whose data is first copied to the result tensor.
- reductionType:
The reduction type applied for all values in the source tensor that the system scatters to a specific location in the result tensor.
Return Value
A scatter tensor.
Discussion
The reductionType property must be MLCReductionType.none or MLCReductionType.sum.