I tried for fun extending autograd since it seems like this operation really doesn’t exist.
Can someone confirm me if this is correct? I tested it and it seems to correctly propagate back the gradients.
from torch.autograd import Function
class Scatter3d(Function):
    @staticmethod
    def forward(ctx, idx1, idx2, idx3, values, shape):
        # ctx is a context object that can be used to stash information
        # for backward computation
        ctx.idx1 = idx1
        ctx.idx2 = idx2
        ctx.idx3 = idx3
        outtensor = torch.zeros(shape)
        outtensor[idx1, idx2, idx3] = values
        return outtensor

    @staticmethod
    def backward(ctx, grad_output):
        # We return as many input gradients as there were arguments.
        # Gradients of non-Tensor arguments to forward must be None.
        return None, None, None, grad_output[ctx.idx1, ctx.idx2, ctx.idx3], None