Implementation of code in https://magazine.sebastianraschka.com/p/understanding-and-coding-self-attention.