This is a practical, easy to download implemenation of 1D, 2D, and 3D sinusodial positional encodings for PyTorch and Tensorflow. This also works on tensors of the form (batchsize, ch, x), etc. See ...