class_docstr: The link encoder module from the `"Do We Really Need Complicated
  Model Architectures for Temporal Networks?"
  <https://openreview.net/forum?id=ayPPc0SyLv1>`_ paper.
  It is composed of two components: (1) :class:`TemporalEncoding` maps each
  edge timestamp to a :obj:`time_channels`-dimensional vector; (2) an MLP
  that groups and maps the :math:`k`-latest encoded timestamps and edge
  features to a :obj:`out_channels`-dimensional representation.
  
  Args:
      k (int): The number of most recent temporal links to use.
      in_channels (int): The edge feature dimensionality.
      hidden_channels (int): Size of each hidden sample.
      time_channels (int): Size of encoded timestamp.
      out_channels (int): Size of each output sample.
      is_sorted (bool, optional): If set to :obj:`True`, assumes that
          :obj:`edge_index` is sorted by column and the
          rows are sorted according to :obj:`edge_time`
          within individual neighborhoods. This avoids internal
          re-sorting of the data and can improve runtime and memory
          efficiency. (default: :obj:`False`)
      dropout (float, optional): Dropout probability of the MLP layer.
          (default: :obj:`0.0`)
docstr: Forward pass.
  
  Args:
      edge_index (torch.Tensor): The edge indices.
      edge_attr (torch.Tensor): The edge features of shape
          :obj:`[num_edges, in_channels]`.
      edge_time (torch.Tensor): The time tensor of shape
          :obj:`[num_edges]`. This can be in the order of millions.
      seed_time (torch.Tensor): The seed time :math:`t_0` for every
          destination node.
  
  Returns:
      A node embedding tensor of shape :obj:`[num_nodes, out_channels]`.
docstr_tok: ["Forward","pass",".","Args",":","edge_index","(","torch.Tensor",")",":","The","edge","indices",".","edge_attr","(","torch.Tensor",")",":","The","edge","features","of","shape",":","obj",":","`","[","num_edges",",","in_channels","]","`",".","edge_time","(","torch.Tensor",")",":","The","time","tensor","of","shape",":","obj",":","`","[","num_edges","]","`",".","This","can","be","in","the","order","of","millions",".","seed_time","(","torch.Tensor",")",":","The","seed","time",":","math",":","`","t_0","`","for","every","destination","node",".","Returns",":","A","node","embedding","tensor","of","shape",":","obj",":","`","[","num_nodes",",","out_channels","]","`","."]
code: def forward(
      self,
      edge_index: Tensor,
      edge_attr: Tensor,
      edge_time: Tensor,
      seed_time: Tensor,
  ) -> Tensor:
      r"""Forward pass.
  
      Args:
          edge_index (torch.Tensor): The edge indices.
          edge_attr (torch.Tensor): The edge features of shape
              :obj:`[num_edges, in_channels]`.
          edge_time (torch.Tensor): The time tensor of shape
              :obj:`[num_edges]`. This can be in the order of millions.
          seed_time (torch.Tensor): The seed time :math:`t_0` for every
              destination node.
  
      Returns:
          A node embedding tensor of shape :obj:`[num_nodes, out_channels]`.
      """
      mask = edge_time <= seed_time[edge_index[1]]
  
      edge_index = edge_index[:, mask]
      edge_attr = edge_attr[mask]
      edge_time = edge_time[mask]
  
      time_enc = self.temporal_encoder(
          seed_time[edge_index[1]] - edge_time
      )
      edge_attr = torch.cat([time_enc, edge_attr], dim=-1)
      edge_attr = self.temporal_head(edge_attr)
  
      edge_attr = get_latest_k_edge_attr(
          k=self.k,
          edge_index=edge_index,
          edge_attr=edge_attr,
          edge_time=edge_time,
          num_nodes=seed_time.size(0),
          is_sorted=self.is_sorted,
      )
  
      return self.mlp_mixer(edge_attr)
  
imports: import numpy
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch.nn import LayerNorm, Linear
  from torch_geometric.nn import TemporalEncoding
  from torch_geometric.utils import scatter, to_dense_batch
label_desc: Use image node_id 3 for calling the LinkEncoder obj's underlying member method code with example usage: obj.forward(edge_index, edge_attr, edge_time, seed_time) and returns: self