Hello, I think, A more elegant way will be to use a function like:
import torch as th

def th_delete(tensor, indices):
    mask = th.ones(tensor.numel(), dtype=th.bool)
    mask[indices] = False
    return tensor[mask]

It can be used like this:
>>> a = th.arange(5)
>>> a
tensor([0, 1, 2, 3, 4])
>>> th_delete(a, [0, 3, 4])
tensor([1, 2])
>>> th_delete(a, [1])
tensor([0, 2, 3, 4])
>>> th_delete(a, th.tensor([1, 4]))
tensor([0, 2, 3])

And even like this:
>>> a = th.arange(5)
>>> a
tensor([0, 1, 2, 3, 4])
>>> th_delete(a, 1)
tensor([0, 2, 3, 4])