I changed it a bit and now I’m getting:
A[batch_size:] = A[:-batch_size].to(device)

RuntimeError: unsupported operation: some elements of the input tensor and the written-to tensor refer to a single memory location. Please clone() the tensor before performing the operation.
But that’s exactly what’s shown being done here: python - Is it possible to create a FIFO queue with pyTorch? - Stack Overflow 5