class_docstr: Base class for edge weightings.
docstr: Compute edge weights.
  
  :param source: shape: (num_edges,)
          The source indices.
  :param target: shape: (num_edges,)
      The target indices.
  :param message: shape (num_edges, dim)
      Actual messages to weight
  :param x_e: shape (num_nodes, dim)
      Node states up to the weighting point
  
  :return: shape: (num_edges, dim)
       Messages weighted with the edge weights.
docstr_tok: ["Compute","edge","weights",".",":","param","source",":","shape",":","(","num_edges",",",")","The","source","indices",".",":","param","target",":","shape",":","(","num_edges",",",")","The","target","indices",".",":","param","message",":","shape","(","num_edges",",","dim",")","Actual","messages","to","weight",":","param","x_e",":","shape","(","num_nodes",",","dim",")","Node","states","up","to","the","weighting","point",":","return",":","shape",":","(","num_edges",",","dim",")","Messages","weighted","with","the","edge","weights","."]
code: def forward(
      self,
      source: torch.LongTensor,
      target: torch.LongTensor,
      message: Optional[torch.FloatTensor] = None,
      x_e: Optional[torch.FloatTensor] = None,
  ) -> torch.FloatTensor:
      """Compute edge weights.
  
      :param source: shape: (num_edges,)
              The source indices.
      :param target: shape: (num_edges,)
          The target indices.
      :param message: shape (num_edges, dim)
          Actual messages to weight
      :param x_e: shape (num_nodes, dim)
          Node states up to the weighting point
  
      :return: shape: (num_edges, dim)
           Messages weighted with the edge weights.
      """
      raise NotImplementedError
  
imports: from abc import abstractmethod
  from typing import ClassVar, Optional, Union
  import torch
  from class_resolver import ClassResolver
  from torch import nn
  from ..utils import einsum
label_desc: Use image node_id 2 for calling the EdgeWeighting obj's underlying member method code with example usage: obj.forward(source, target, message, x_e) without return types