code: def predict_r_uncertain(
      model: Model,
      ht_batch: torch.LongTensor,
      num_samples: int = 5,
      slice_size: Optional[int] = None,
      *,
      mode: Optional[InductiveMode] = None,
  ) -> UncertainPrediction:
      """Forward pass using middle (relation) prediction for obtaining scores of all possible relations.
  
      This method calculates the score for all possible relations for each (head, tail)
      pair, as well as an uncertainty quantification.
  
      :param model:
          the model used for predicting scores
      :param ht_batch: shape: (batch_size, 2)
          The indices of (head, tail) pairs.
      :param slice_size: >0
          The divisor for the scoring function when using slicing.
      :param num_samples: >1
          the number of samples to draw
      :param mode:
          The pass mode, which is None in the transductive setting and one of "training",
          "validation", or "testing" in the inductive setting.
  
      :return: shape: (batch_size, num_relations)
          For each h-t pair, the scores for all possible relations.
  
          This function delegates to :func:`predict_uncertain_helper` by using
          :func:`pykeen.models.Model.score_r` as the ``score_method``.
  
      .. warning::
          This function sets the model to evaluation mode and all dropout layers
          to training mode.
      """
      return predict_uncertain_helper(
          model=model,
          batch=ht_batch,
          score_method=model.score_r,
          num_samples=num_samples,
          slice_size=slice_size,
          mode=mode,
      )
  
file_path: pykeen/src/pykeen/models/uncertainty.py
imports: from typing import Callable, NamedTuple, Optional
  import torch
  from .base import Model
  from ..typing import InductiveMode
  from ..utils import get_dropout_modules
label_desc: Use image node_id 4 for calling a global function with example usage: predict_r_uncertain(model, ht_batch, num_samples, slice_size) and returns: predict_uncertain_helper