class_docstr: See :class:`torch_geometric.nn.conv.SAGEConv`.
  
  .. note::
  
      :class:`~torch_geometric.nn.dense.DenseSAGEConv` expects to work on
      binary adjacency matrices.
      If you want to make use of weighted dense adjacency matrices, please
      use :class:`torch_geometric.nn.dense.DenseGraphConv` instead.
class_docstr_tok: ["See",":","class",":","`","torch_geometric.nn.conv.SAGEConv","`",".","..","note",":",":",":","class",":","`","~torch_geometric.nn.dense.DenseSAGEConv","`","expects","to","work","on","binary","adjacency","matrices",".","If","you","want","to","make","use","of","weighted","dense","adjacency","matrices",",","please","use",":","class",":","`","torch_geometric.nn.dense.DenseGraphConv","`","instead","."]
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`)
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","`",")"]
code: def forward(
      self, x: Tensor, adj: Tensor, mask: OptTensor = None
  ) -> 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`)
      """
      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)
      out = out / adj.sum(dim=-1, keepdim=True).clamp(min=1)
      out = self.lin_rel(out) + self.lin_root(x)
  
      if self.normalize:
          out = F.normalize(out, p=2.0, dim=-1)
  
      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_sage_conv.py
imports: import torch
  import torch.nn.functional
  from torch import Tensor
  from torch.nn import Linear
  from torch_geometric.typing import OptTensor
label_desc: Use image node_id 3 for calling the DenseSAGEConv obj's underlying member method code with example usage: obj.forward(x, adj, mask) and returns: out