There are different approaches towards attention. If I remember correctly, this tutorial implements the Bahdanau Attention. Very popular is also Luong Attention, which is arguably simply, at least with respect to coding – I don’t make any claims about effectiveness.
This Stackoverflow post discusses both approaches and contains good illustrations and additional links to other good sources.