Solved by user29 in post #2 
              
              
                It is not pytorch, it is IPython. IPython create variables like ___{number of row}. If remove this variable with all references (use %xdel) memory free