Skip to main content

ClikaRT::ops::scatter_add

function

scatter_add()

Tensor scatter_add(
    Tensor x,
    int64_t dim,
    Tensor index,
    Tensor src,
    bool deterministic = false
)

scatter with ACCUMULATION: out[.., index[p], ..] += src[p]; duplicate destinations sum.

Parameters

  • deterministic: selects the deterministic accumulate path on devices where the faster default is run-to-run-variable on duplicate destinations (device atomics); the CPU is deterministic regardless of the flag. Default false.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when dim is out of range, the shapes disagree, or the index dtype is wrong (code_name() carries the reason).

Returns: a new tensor shaped like x.

Declared in ClikaRT/compute/ops.h, line 2579