def METHOD_NAME(self, user_idx, item_idx=None):
    """Predict the scores/ratings of a user for an item.
    Parameters
    ----------
    user_idx: int, required
        The index of the user for whom to perform score prediction.
    item_idx: int, optional, default: None
        The index of the item for which to perform score prediction.
        If None, scores for all known items will be returned.
    Returns
    -------
    res : A scalar or a Numpy array
        Relative scores that the user gives to the item or to all known items
    """
    import torch
    if item_idx is None:
        if self.train_set.is_unk_user(user_idx):
            raise ScoreException(
                "Can't make score prediction for (user_id=%d)" % user_idx
            )
        x_u = self.train_set.matrix[user_idx].copy()
        x_u.data = np.ones(len(x_u.data))
        z_u, _ = self.vae.encode(
            torch.tensor(x_u.A, dtype=torch.float32, device=self.device)
        )
        known_item_scores = self.vae.decode(z_u).data.cpu().numpy().flatten()
        return known_item_scores
    else:
        if self.train_set.is_unk_user(user_idx) or self.train_set.is_unk_item(
            item_idx
        ):
            raise ScoreException(
                "Can't make score prediction for (user_id=%d, item_id=%d)"
                % (user_idx, item_idx)
            )
        x_u = self.train_set.matrix[user_idx].copy()
        x_u.data = np.ones(len(x_u.data))
        z_u, _ = self.vae.encode(
            torch.tensor(x_u.A, dtype=torch.float32, device=self.device)
        )
        user_pred = (
            self.vae.decode(z_u).data.cpu().numpy().flatten()[item_idx]
        )  # Fix me I am not efficient
        return user_pred