I see you're using numpy arrays. In that case, you can also do this:
input_seq[[ix1, ix2]] = input_seq[[ix2, ix1]]
To explain this a bit:
input_seq[ix1] = 5 # sets value at index `ix1` to `5`
input_seq[ix2] = 42 # sets value at index `ix2` to `42`
You can also do this:
ixs = [ix1, ix2] # create a list of indices to alter
input_seq[ixs] = [5, 42] # sets the two values simultaneously
To even shorten this further, substituting ixs:
input_seq[[ix1, ix2]] = [5, 42] # sets the two values simultaneously in one line
Now Python has a very nice feature in which you can swap two variables like this without a temporary variable:
a, b = b, a # swap the values of a and b
So if you know you can read two variables by index from the array like this:
input_seq[[ix2, ix1]] # reads two values
You can set them as explained in the top of this comment.