def __init__(self, d_k, dropout): super().__init__() self.temper = np.power(d_k, 0.5) self.dropout = nn.Dropout(dropout) self.softmax = nn.Softmax()