class_docstr: A representation with message passing with uses categorical relation type information.
  
  The message passing layers of this module internally handle the categorical relation type information
  via an `edge_type` input, e.g., :class:`torch_geometric.nn.conv.RGCNConv`, or
  :class:`torch_geometric.nn.conv.RGATConv`.
  
  The following example creates a one-layer RGCN using the basis decomposition:
  
  .. code-block:: python
  
      from pykeen.datasets import get_dataset
  
      embedding_dim = 64
      dataset = get_dataset(dataset="nations")
      r = TypedMessagePassingRepresentation(
          triples_factory=dataset.training,
          base_kwargs=dict(shape=embedding_dim),
          layers="rgcn",
          layers_kwargs=dict(
              in_channels=embedding_dim,
              out_channels=embedding_dim,
              num_bases=2,
              num_relations=dataset.num_relations,
          ),
      )
  
  ---
  name: Typed Message Passing
docstr: Initialize the representation.
  
  :param triples_factory:
      the factory comprising the training triples used for message passing
  :param kwargs:
      additional keyword-based parameters passed to :meth:`MessagePassingRepresentation.__init__`
docstr_tok: ["Initialize","the","representation",".",":","param","triples_factory",":","the","factory","comprising","the","training","triples","used","for","message","passing",":","param","kwargs",":","additional","keyword-based","parameters","passed","to",":","meth",":","`","MessagePassingRepresentation.__init__","`"]
code: def __init__(self, triples_factory: CoreTriplesFactory, **kwargs):
      """
      Initialize the representation.
  
      :param triples_factory:
          the factory comprising the training triples used for message passing
      :param kwargs:
          additional keyword-based parameters passed to :meth:`MessagePassingRepresentation.__init__`
      """
      super().__init__(triples_factory=triples_factory, **kwargs)
      # register an additional buffer for the categorical edge type
      self.register_buffer(
          name="edge_type", tensor=triples_factory.mapped_triples[:, 1]
      )
  
imports: from abc import ABC, abstractmethod
  from typing import Collection, Literal, Optional, Sequence
  import torch
  from class_resolver import ClassResolver, HintOrType, OneOrManyHintOrType, OneOrManyOptionalKwargs, OptionalKwargs
  from class_resolver.contrib.torch import activation_resolver
  from docdata import parse_docdata
  from torch import nn
  from .representation import Representation
  from .utils import ShapeError
  from ..triples.triples_factory import CoreTriplesFactory
  from ..typing import OneOrSequence
  from ..utils import get_edge_index, upgrade_to_sequence
label_desc: Use image node_id 1 to create a new TypedMessagePassingRepresentation object from inherited base classes: MessagePassingRepresentation with example: obj = TypedMessagePassingRepresentation(triples_factory)