Solved by Adamits in post #4 
              
              
                Note: this feature was merged  on Jan 23 - https://github.com/pytorch/pytorch/pull/31996 - and is not in the pip distribution of pytorch 
EDIT: Note that this is available in the most recent pip release, 1.5: https://github.com/pytorch/pytorch/releases