Database, Tech.
label_aware_attention(self, keys, query): weight = paddle.sum(keys * query, axis=-1, keepdim=True) weight = paddle.pow(weight, self.pow_p) # [x,k_max,1] weight = F.softmax(weight, axis=1) output = paddle.sum(keys * weight, axis=1) return output, weight def forward(self, hist_item, seqlen,