I’m not sure, how you would like to apply scatter in this case, as dim1 only is of size 1.
You would get this operation:

self[i][index[i][j][k]][k] = src[i][j][k]  # if dim == 1

, which means that your scatter index (target in your case` can only hold zeros.
Other values will yield an invalid index.
Could you post a small sample with values and how the result should look like?