Solved by tom in post #2 
              
              
                That’s because the data is on the CPU and you’re instructing PyTorch to treat the CPU-pointer tensor2Data as a GPU pointer. You’d need to make it a tensor first and then move to CUDA. 
As an aside, tensor indexing as in tensor1[0][0][0][0]=42; is not efficient if you do it at scale. This statement w…