def full_sort_predict(self, interaction):
    user_index = interaction[self.USER_ID]
    item_index = torch.tensor(range(self.n_items)).to(self.device)
    user = torch.unsqueeze(user_index, dim=1).repeat(1, item_index.shape[0])
    user = torch.flatten(user)
    item = torch.unsqueeze(item_index, dim=0).repeat(user_index.shape[0], 1)
    item = torch.flatten(item)
    (user_e, item_e) = self.forward(user, item)
    score = torch.mul(user_e, item_e).sum(dim=1)
    return score.view((- 1))
def full_sort_predict(self, interaction):
    user_index = interaction[self.USER_ID]
    item_index = torch.tensor(range(self.n_items)).to(self.device)
    user = torch.unsqueeze(user_index, dim=1).repeat(1, item_index.shape[0])
    user = torch.flatten(user)
    item = torch.unsqueeze(item_index, dim=0).repeat(user_index.shape[0], 1)
    item = torch.flatten(item)
    (user_e, item_e) = self.forward(user, item)
    score = torch.mul(user_e, item_e).sum(dim=1)
    return score.view((- 1))