Solved by tom in post #2 
              
              
                I didn’t write that code, I just used it for benchmarking. 
So are you using PyTorch 1.3? Maybe making those a plain Tensor tuple instead of a Namedtuple helps. 
Best regards 
Thomas