The best way is going to pytorch official website and coping the code presented since it gives the best version according to your systems requirements