Yea the error is no problem as its extremely small, I was a bit curious for why it happens only when using advanced indexing but it doesnt really matter!
Another question:
Lets say I want to sigmoid index [0, 1, 4] and the slice [6:]. Is there a speed difference between doing it all in one operation like this:
x = ... # vector
indices = [0, 1, 4] + list(range(6, x.size(0)))
x[indices] = F.sigmoid(x[indices])

or like this:
x = ... # vector
indices = [0, 1, 4]
x[indices] = F.sigmoid(x[0, 1, 4])
x[6:] = = F.sigmoid(x[6:])

Or is the operation on advanced indexing the same as with slicing, ie:
x[:4] = F.sigmoid(x[:4])

is the same as
x[[0, 1, 2, 3]] = F.sigmoid(x[[0, 1, 2, 3]])

I know these produce the same result but I am wondering if they are performed differently “under the hood”. If slices are more effective as data might be contiguous, are a list of indexes such as [0, 1, 2, 3] viewed as a slice?
I know its quite a weird question and I could not find an answer for it. I dont think it makes any noticeable difference for my implementation, this is more out of curiosity.