Write source into input at the flat positions in index.
Mirrors the reference framework's Tensor.put semantics: indices
refer to the row-major linearisation of input, regardless of its
shape, and a negative one counts from the end. accumulate=True
performs additive scatter (duplicates add). Otherwise a position
named twice keeps the last write on the CPU and one of its values,
which one unspecified, on Metal (scatter semantics).
Parameters
inputTensorDestination — its shape is preserved in the output.
indexTensorInteger tensor of any shape of flat positions in
[-input.numel(), input.numel()).sourceTensorValues of
input's dtype, as many as index has.accumulatebool= FalseIf True, add to the existing value at each position; otherwise
overwrite.
Returns
TensorA new tensor of input's shape and dtype.
Raises
lucid._C.engine.DtypeMismatchsource's dtype is not input's.IndexErrorsource and index hold different numbers of elements, or —
on the CPU — an index is out of range; Metal drops such a write.