Hey,
I am working on a yolo implementation that has similar parts as the implementation 2 by ayooshkathuria.
In one of those places he sigmoids a number of elements in a tensor by doing it 3 times for 3 different indexes.
I did the same operation with advanced indexing. However, I noticed that the results were different from his so I did some tests
I got the tensor from my implementation (x1) and the tensor from his implementation (x2) just before the step that made them have slightly different values. I saved these tensors for testing and ran the tests in a notebook.

Screen Shot 2018-07-23 at 17.11.15.png1662×1836 345 KB

As you can see, the tensors have the exact same values before the sigmoid operation is performed. I could only replicate the results with these tensors. I tried creating x1 with torch.rand and then copying it to x2 but then the results are correct. I also tried using just x1 where x2 = x1.detach() but those results were also correct.
The incorrect results only show when using the CPU and advanced indexing.
The difference is not large enough to affect the results. I am just curious as to why this happens. Am I using advanced indexing incorrectly?