import torch.nn.functional as F ​ attention_weights_2 = F.softmax(omega_2 / d_k**0.5, dim=0) print(attention_weights_2)