class_docstr: A base module for KGE models.
  
  Subclasses of :class:`Model` can decide however they want on how to store entities' and
  relations' representations, how they want to be looked up, and how they should
  be scored. The :class:`OModel` provides a commonly used interface for models storing entity
  and relation representations in the form of :class:`pykeen.nn.Embedding`.
class_docstr_tok: ["A","base","module","for","KGE","models",".","Subclasses","of",":","class",":","`","Model","`","can","decide","however","they","want","on","how","to","store","entities","'","and","relations","'","representations",",","how","they","want","to","be","looked","up",",","and","how","they","should","be","scored",".","The",":","class",":","`","OModel","`","provides","a","commonly","used","interface","for","models","storing","entity","and","relation","representations","in","the","form","of",":","class",":","`","pykeen.nn.Embedding","`","."]
docstr: Forward pass using left side (head) prediction.
  
  This method calculates the score for all possible heads for each (relation, tail) pair.
  
  :param rt_batch: shape: (batch_size, 2), dtype: long
      The indices of (relation, tail) pairs.
  :param slice_size: >0
      The divisor for the scoring function when using slicing.
  :param mode:
      The pass mode, which is None in the transductive setting and one of "training",
      "validation", or "testing" in the inductive setting.
  :param heads: shape: (num_heads,) | (batch_size, num_heads)
      head entity indices to score against. If None, scores against all entities (from the given mode).
  
  :return: shape: (batch_size, num_heads), dtype: float
      For each r-t pair, the scores for all possible heads.
docstr_tok: ["Forward","pass","using","left","side","(","head",")","prediction",".","This","method","calculates","the","score","for","all","possible","heads","for","each","(","relation",",","tail",")","pair",".",":","param","rt_batch",":","shape",":","(","batch_size",",","2",")",",","dtype",":","long","The","indices","of","(","relation",",","tail",")","pairs",".",":","param","slice_size",":",">","0","The","divisor","for","the","scoring","function","when","using","slicing",".",":","param","mode",":","The","pass","mode",",","which","is","None","in","the","transductive","setting","and","one","of","``","training","''",",","``","validation","''",",","or","``","testing","''","in","the","inductive","setting",".",":","param","heads",":","shape",":","(","num_heads",",",")","|","(","batch_size",",","num_heads",")","head","entity","indices","to","score","against",".","If","None",",","scores","against","all","entities","(","from","the","given","mode",")",".",":","return",":","shape",":","(","batch_size",",","num_heads",")",",","dtype",":","float","For","each","r-t","pair",",","the","scores","for","all","possible","heads","."]
code: def score_h(
      self,
      rt_batch: torch.LongTensor,
      *,
      slice_size: Optional[int] = None,
      mode: Optional[InductiveMode] = None,
      heads: Optional[torch.LongTensor] = None,
  ) -> torch.FloatTensor:
      """Forward pass using left side (head) prediction.
  
      This method calculates the score for all possible heads for each (relation, tail) pair.
  
      :param rt_batch: shape: (batch_size, 2), dtype: long
          The indices of (relation, tail) pairs.
      :param slice_size: >0
          The divisor for the scoring function when using slicing.
      :param mode:
          The pass mode, which is None in the transductive setting and one of "training",
          "validation", or "testing" in the inductive setting.
      :param heads: shape: (num_heads,) | (batch_size, num_heads)
          head entity indices to score against. If None, scores against all entities (from the given mode).
  
      :return: shape: (batch_size, num_heads), dtype: float
          For each r-t pair, the scores for all possible heads.
      """
  
imports: from __future__ import annotations
  import inspect
  import logging
  import os
  import pickle
  from abc import ABC, abstractmethod
  from typing import Any, ClassVar, Iterable, Mapping, Optional, Type, Union
  import torch
  from class_resolver import HintOrType
  from docdata import parse_docdata
  from torch import nn
  from ..inverse import RelationInverter, relation_inverter_resolver
  from ..losses import Loss, MarginRankingLoss, loss_resolver
  from ..triples import KGInfo
  from ..typing import LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, InductiveMode, MappedTriples, Target
  from ..utils import NoRandomSeedNecessary, get_preferred_device, set_random_seed
label_desc: Use image node_id 14 for calling the Model obj's underlying member method code with example usage: obj.score_h(rt_batch) without return types