Solved by dfilipiak in post #5 
              
              
                Thanks - it helped me to move forward. Turns out this feature is available in PyTorch 1.9.0 (was using 1.7.0), so no need to use nightly builds. 
Now I have this error: 
RuntimeError: Expected to mark a variable ready only once. This error is caused by one of the following reasons: 1) Use of a modul…