Looking for correct version of pytorch for RTX 4090, CUDA 12.2

The error message points towards an indexing error and is unrelated to the used PyTorch binary.
Narrow down the failing indexing operation and fix it.