fn
scatter_add_op
→TensorImplPtrint scatter_add_op(const int & base, const int & indices, const int & src, int dim)Python wrappers
Public Python APIs implemented by this engine symbol.User-facing scatter-add: out = base with src accumulated at positions given by indices along dim.
Math
Parameters
baseTensorImplPtrTensor providing the initial values; same shape as the output.
indicesTensorImplPtrint32 or int64 tensor indexing into
base along dim. Shape matches src.srcTensorImplPtrValues to add, in
base's dtype.dimintAxis along which scattering occurs.
Returns
TensorImplPtrSame shape and dtype as base.
Raises
DtypeMismatchIf
src is not in base's dtype or indices is not int32 / int64 — the rule of scatter_amax_op, scatter_amin_op, scatter_prod_op and scatter_set_op too. Nothing is cast.Notes
Full autograd support. Gradients: , .