class_docstr: See :class:`torch_geometric.nn.conv.GINConv`.
class_docstr_tok: ["See",":","class",":","`","torch_geometric.nn.conv.GINConv","`","."]
docstr: Forward pass.
  
  Args:
      x (torch.Tensor): Node feature tensor
          :math:`\mathbf{X} \in \mathbb{R}^{B \times N \times F}`, with
          batch-size :math:`B`, (maximum) number of nodes :math:`N` for
          each graph, and feature dimension :math:`F`.
      adj (torch.Tensor): Adjacency tensor
          :math:`\mathbf{A} \in \mathbb{R}^{B \times N \times N}`.
          The adjacency tensor is broadcastable in the batch dimension,
          resulting in a shared adjacency matrix for the complete batch.
      mask (torch.Tensor, optional): Mask matrix
          :math:`\mathbf{M} \in {\{ 0, 1 \}}^{B \times N}` indicating
          the valid nodes for each graph. (default: :obj:`None`)
      add_loop (bool, optional): If set to :obj:`False`, the layer will
          not automatically add self-loops to the adjacency matrices.
          (default: :obj:`True`)
docstr_tok: ["Forward","pass",".","Args",":","x","(","torch.Tensor",")",":","Node","feature","tensor",":","math",":","`","\\mathbf","{","X","}","\\in","\\mathbb","{","R","}","^","{","B","\\times","N","\\times","F","}","`",",","with","batch-size",":","math",":","`","B","`",",","(","maximum",")","number","of","nodes",":","math",":","`","N","`","for","each","graph",",","and","feature","dimension",":","math",":","`","F","`",".","adj","(","torch.Tensor",")",":","Adjacency","tensor",":","math",":","`","\\mathbf","{","A","}","\\in","\\mathbb","{","R","}","^","{","B","\\times","N","\\times","N","}","`",".","The","adjacency","tensor","is","broadcastable","in","the","batch","dimension",",","resulting","in","a","shared","adjacency","matrix","for","the","complete","batch",".","mask","(","torch.Tensor",",","optional",")",":","Mask","matrix",":","math",":","`","\\mathbf","{","M","}","\\in","{","\\","{","0",",","1","\\","}","}","^","{","B","\\times","N","}","`","indicating","the","valid","nodes","for","each","graph",".","(","default",":",":","obj",":","`","None","`",")","add_loop","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","layer","will","not","automatically","add","self-loops","to","the","adjacency","matrices",".","(","default",":",":","obj",":","`","True","`",")"]
code: def forward(
      self,
      x: Tensor,
      adj: Tensor,
      mask: Optional[Tensor] = None,
      add_loop: bool = True,
  ) -> Tensor:
      r"""Forward pass.
  
      Args:
          x (torch.Tensor): Node feature tensor
              :math:`\mathbf{X} \in \mathbb{R}^{B \times N \times F}`, with
              batch-size :math:`B`, (maximum) number of nodes :math:`N` for
              each graph, and feature dimension :math:`F`.
          adj (torch.Tensor): Adjacency tensor
              :math:`\mathbf{A} \in \mathbb{R}^{B \times N \times N}`.
              The adjacency tensor is broadcastable in the batch dimension,
              resulting in a shared adjacency matrix for the complete batch.
          mask (torch.Tensor, optional): Mask matrix
              :math:`\mathbf{M} \in {\{ 0, 1 \}}^{B \times N}` indicating
              the valid nodes for each graph. (default: :obj:`None`)
          add_loop (bool, optional): If set to :obj:`False`, the layer will
              not automatically add self-loops to the adjacency matrices.
              (default: :obj:`True`)
      """
      x = x.unsqueeze(0) if x.dim() == 2 else x
      adj = adj.unsqueeze(0) if adj.dim() == 2 else adj
      B, N, _ = adj.size()
  
      out = torch.matmul(adj, x)
      if add_loop:
          out = (1 + self.eps) * x + out
  
      out = self.nn(out)
  
      if mask is not None:
          out = out * mask.view(B, N, 1).to(x.dtype)
  
      return out
  
file_path: pytorch_geometric/torch_geometric/nn/dense/dense_gin_conv.py
imports: from typing import Optional
  import torch
  from torch import Tensor
  from torch.nn import Module
  from torch_geometric.nn.inits import reset
label_desc: Use image node_id 3 for calling the DenseGINConv obj's underlying member method code with example usage: obj.forward(x, adj, mask, add_loop) and returns: out