class_docstr: Base module for relation-specific message passing.
  
  A decomposition module implementation offers a way to reduce the number of parameters needed by learning
  independent $d^2$ matrices for each relation. In R-GCN, the two proposed variants are treated as
  hyper-parameters, and for different datasets different decompositions are superior in performance.
  
  The decomposition module itself does not compute the full matrix from the factors, but rather provides efficient
  means to compute the product of the factorized matrix with the source nodes' latent features to construct the
  messages. This is usually more efficient than constructing the full matrices.
  
  For an intuition, you can think about a simple low-rank matrix factorization of rank `1`, where $W = w w^T$
  for a $d$-dimensional vector `w`. Then, computing $Wv$ as $(w w^T) v$ gives you an intermediate result of size
  $d \times d$, while you can also compute $w(w^Tv)$, where the intermediate result is just a scalar.
  
  The implementations use the efficient version based on adjacency tensor stacking from [thanapalasingam2021]_.
  The adjacency tensor is reshaped into a sparse matrix to support message passing by a
  single sparse matrix multiplication, cf. :func:`pykeen.nn.utils.adjacency_tensor_to_stacked_matrix`.
  
  .. note ::
      this module does neither take care of the self-loop, nor of applying an activation function.
class_docstr_tok: ["Base","module","for","relation-specific","message","passing",".","A","decomposition","module","implementation","offers","a","way","to","reduce","the","number","of","parameters","needed","by","learning","independent","$","d^2","$","matrices","for","each","relation",".","In","R-GCN",",","the","two","proposed","variants","are","treated","as","hyper-parameters",",","and","for","different","datasets","different","decompositions","are","superior","in","performance",".","The","decomposition","module","itself","does","not","compute","the","full","matrix","from","the","factors",",","but","rather","provides","efficient","means","to","compute","the","product","of","the","factorized","matrix","with","the","source","nodes","'","latent","features","to","construct","the","messages",".","This","is","usually","more","efficient","than","constructing","the","full","matrices",".","For","an","intuition",",","you","can","think","about","a","simple","low-rank","matrix","factorization","of","rank","`","1","`",",","where","$","W","=","w","w^T","$","for","a","$","d","$","-dimensional","vector","`","w","`",".","Then",",","computing","$","Wv","$","as","$","(","w","w^T",")","v","$","gives","you","an","intermediate","result","of","size","$","d","\\times","d","$",",","while","you","can","also","compute","$","w","(","w^Tv",")","$",",","where","the","intermediate","result","is","just","a","scalar",".","The","implementations","use","the","efficient","version","based","on","adjacency","tensor","stacking","from","[","thanapalasingam2021","]","_",".","The","adjacency","tensor","is","reshaped","into","a","sparse","matrix","to","support","message","passing","by","a","single","sparse","matrix","multiplication",",","cf",".",":","func",":","`","pykeen.nn.utils.adjacency_tensor_to_stacked_matrix","`",".","..","note",":",":","this","module","does","neither","take","care","of","the","self-loop",",","nor","of","applying","an","activation","function","."]
docstr: Iterate over components for `extra_repr`.
code: def iter_extra_repr(self) -> Iterable[str]:
      """Iterate over components for `extra_repr`."""
      yield from super().iter_extra_repr()
      yield f"input_dim={self.input_dim}"
      yield f"output_dim={self.output_dim}"
      yield f"num_relations={self.num_relations}"
  
imports: import logging
  import math
  from abc import ABC, abstractmethod
  from typing import Any, Iterable, Mapping, Optional, Sequence
  import torch
  from class_resolver import ClassResolver, Hint, HintOrType, OptionalKwargs
  from class_resolver.contrib.torch import activation_resolver
  from docdata import parse_docdata
  from torch import nn
  from .init import uniform_norm_p1_, xavier_normal_
  from .representation import LowRankRepresentation, Representation
  from .utils import ShapeError, adjacency_tensor_to_stacked_matrix, use_horizontal_stacking
  from .weighting import EdgeWeighting, edge_weight_resolver
  from ..triples import CoreTriplesFactory
  from ..utils import ExtraReprMixin, einsum
label_desc: Use image node_id 2 for calling the Decomposition obj's underlying member method code with example usage: obj.iter_extra_repr() without return types