class_docstr: Inductive NodePiece with a GNN encoder on top.
  
  Overall, it's a 3-step procedure:
  
  1. Featurizing nodes via NodePiece
  2. Message passing over the active graph using NodePiece features
  3. Scoring function for a given batch of triples
  
  As of now, message passing is expected to be over the full graph
class_docstr_tok: ["Inductive","NodePiece","with","a","GNN","encoder","on","top",".","Overall",",","it","'s","a","3-step","procedure",":","1",".","Featurizing","nodes","via","NodePiece","2",".","Message","passing","over","the","active","graph","using","NodePiece","features","3",".","Scoring","function","for","a","given","batch","of","triples","As","of","now",",","message","passing","is","expected","to","be","over","the","full","graph"]
docstr: Get representations for head, relation and tails, in canonical shape with a GNN encoder.
docstr_tok: ["Get","representations","for","head",",","relation","and","tails",",","in","canonical","shape","with","a","GNN","encoder","."]
code: def _get_representations(
      self,
      h: Optional[torch.LongTensor],
      r: Optional[torch.LongTensor],
      t: Optional[torch.LongTensor],
      mode: Optional[InductiveMode] = None,
  ) -> Tuple[
      HeadRepresentation, RelationRepresentation, TailRepresentation
  ]:
      """Get representations for head, relation and tails, in canonical shape with a GNN encoder."""
      entity_representations = (
          self._get_entity_representations_from_inductive_mode(
              mode=mode
          )
      )
  
      # Extract all entity and relation representations
      x_e, x_r = (
          entity_representations[0](),
          self.relation_representations[0](),
      )
  
      # Perform message passing and get updated states
      for layer in self.gnn_encoder:
          x_e, x_r = layer(
              x_e=x_e,
              x_r=x_r,
              edge_index=getattr(self, f"{mode}_edge_index"),
              edge_type=getattr(self, f"{mode}_edge_type"),
          )
  
      # Use updated entity and relation states to extract requested IDs
      # TODO I got lost in all the Representation Modules and shape casting and wrote this ;(
  
      hh, rr, tt = [
          x_e[h] if h is not None else x_e,
          x_r[r] if r is not None else x_r,
          x_e[t] if t is not None else x_e,
      ]
  
      # normalization
      return cast(
          Tuple[
              HeadRepresentation,
              RelationRepresentation,
              TailRepresentation,
          ],
          tuple(x[0] if len(x) == 1 else x for x in (hh, rr, tt)),
      )
  
file_path: pykeen/src/pykeen/models/inductive/inductive_nodepiece_gnn.py
imports: import logging
  from typing import Iterable, Optional, Tuple, cast
  import torch
  from torch import nn
  from .inductive_nodepiece import InductiveNodePiece
  from ...nn.representation import CompGCNLayer
  from ...typing import HeadRepresentation, InductiveMode, RelationRepresentation, TailRepresentation
  from ...utils import get_edge_index
label_desc: Use image node_id 3 for calling the InductiveNodePieceGNN obj's underlying member method code with example usage: obj._get_representations(h, r, t, mode) and returns: cast