output is given as:
  self[index[i], :, :] *= src[i, :, :]  # if dim == 0
  self[:, index[i], :] *= src[:, i, :]  # if dim == 1
  self[:, :, index[i]] *= src[:, :, i]  # if dim == 2

Note:
 This operation may behave nondeterministically when given tensors
 on a CUDA device. See Reproducibility for more information.

Note:
 This function only supports floating point tensors.

Warning:
 This function is in beta and may change in the near future.

Parameters:
      * dim (int) -- dimension along which to index
  * **index** (*Tensor*) -- indices of "source" to select from,
    should have dtype either *torch.int64* or *torch.int32*

  * **source** (*FloatTensor*) -- the tensor containing values to
    accumulate

  * **reduce** (*str*) -- the reduction operation to apply
    (""prod"", ""mean"", ""amax"", ""amin"")

Keyword Arguments:
      include_self (bool) -- whether the elements from the