Installing Pytorch with AMD ROCm on GNU/Linux

Quickly sharing my notes on how to install drivers for ROCm and Pytorch for machine learning on AMD GPUs: