class_docstr: Build `DistMult
  <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/ICLR2015_updated.pdf>`_ factorization
  as GripNet decoder in PoSE dataset.
  Copy-paste with slight modifications from https://github.com/NYXFLOWER/GripNet.
  
  Args:
      in_channels (int): the dimension of input feature.
      num_edge_type (int): the number of edge types.
docstr: Args:
      x: the input node feature embeddings.
      edge_index: the edge index in COO format with shape [2, num_edges].
      edge_type: the one-dimensional relation type/index for each target edge in edge_index.
      sigmoid: whether to use sigmoid function or not.
docstr_tok: ["Args",":","x",":","the","input","node","feature","embeddings",".","edge_index",":","the","edge","index","in","COO","format","with","shape","[","2",",","num_edges","]",".","edge_type",":","the","one-dimensional","relation","type\/index","for","each","target","edge","in","edge_index",".","sigmoid",":","whether","to","use","sigmoid","function","or","not","."]
code: def forward(
      self,
      x,
      edge_index: torch.Tensor,
      edge_type: torch.Tensor,
      sigmoid: bool = True,
  ) -> torch.Tensor:
      """
      Args:
          x: the input node feature embeddings.
          edge_index: the edge index in COO format with shape [2, num_edges].
          edge_type: the one-dimensional relation type/index for each target edge in edge_index.
          sigmoid: whether to use sigmoid function or not.
      """
      value = (
          x[edge_index[0]] * x[edge_index[1]] * self.weight[edge_type]
      ).sum(dim=1)
      return torch.sigmoid(value) if sigmoid else value
  
imports: from typing import List, Tuple
  import numpy
  import pytorch_lightning
  import torch
  import torch.nn
  import torch.nn.functional
  from kale.embed.gripnet import GripNet
  from kale.evaluate.metrics import auprc_auroc_ap
  from kale.prepdata.graph_negative_sampling import typed_negative_sampling
  from kale.prepdata.supergraph_construct import SuperGraph
  from kale.utils.initialize_nn import bias_init, xavier_init
label_desc: Use image node_id 2 for calling the DistMultDecoder obj's underlying member method code with example usage: obj.forward(x, edge_index, edge_type, sigmoid) and returns: unknown