class_docstr: The signed graph convolutional operator from the `"Signed Graph
  Convolutional Network" <https://arxiv.org/abs/1808.06354>`_ paper.
  
  .. math::
      \mathbf{x}_v^{(\textrm{pos})} &= \mathbf{\Theta}^{(\textrm{pos})}
      \left[ \frac{1}{|\mathcal{N}^{+}(v)|} \sum_{w \in \mathcal{N}^{+}(v)}
      \mathbf{x}_w , \mathbf{x}_v \right]
  
      \mathbf{x}_v^{(\textrm{neg})} &= \mathbf{\Theta}^{(\textrm{neg})}
      \left[ \frac{1}{|\mathcal{N}^{-}(v)|} \sum_{w \in \mathcal{N}^{-}(v)}
      \mathbf{x}_w , \mathbf{x}_v \right]
  
  if :obj:`first_aggr` is set to :obj:`True`, and
  
  .. math::
      \mathbf{x}_v^{(\textrm{pos})} &= \mathbf{\Theta}^{(\textrm{pos})}
      \left[ \frac{1}{|\mathcal{N}^{+}(v)|} \sum_{w \in \mathcal{N}^{+}(v)}
      \mathbf{x}_w^{(\textrm{pos})}, \frac{1}{|\mathcal{N}^{-}(v)|}
      \sum_{w \in \mathcal{N}^{-}(v)} \mathbf{x}_w^{(\textrm{neg})},
      \mathbf{x}_v^{(\textrm{pos})} \right]
  
      \mathbf{x}_v^{(\textrm{neg})} &= \mathbf{\Theta}^{(\textrm{pos})}
      \left[ \frac{1}{|\mathcal{N}^{+}(v)|} \sum_{w \in \mathcal{N}^{+}(v)}
      \mathbf{x}_w^{(\textrm{neg})}, \frac{1}{|\mathcal{N}^{-}(v)|}
      \sum_{w \in \mathcal{N}^{-}(v)} \mathbf{x}_w^{(\textrm{pos})},
      \mathbf{x}_v^{(\textrm{neg})} \right]
  
  otherwise.
  In case :obj:`first_aggr` is :obj:`False`, the layer expects :obj:`x` to be
  a tensor where :obj:`x[:, :in_channels]` denotes the positive node features
  :math:`\mathbf{X}^{(\textrm{pos})}` and :obj:`x[:, in_channels:]` denotes
  the negative node features :math:`\mathbf{X}^{(\textrm{neg})}`.
  
  Args:
      in_channels (int): Size of each input sample, or :obj:`-1` to derive
          the size from the first input(s) to the forward method.
      out_channels (int): Size of each output sample.
      first_aggr (bool): Denotes which aggregation formula to use.
      bias (bool, optional): If set to :obj:`False`, the layer will not learn
          an additive bias. (default: :obj:`True`)
      **kwargs (optional): Additional arguments of
          :class:`torch_geometric.nn.conv.MessagePassing`.
  
  Shapes:
      - **input:**
        node features :math:`(|\mathcal{V}|, F_{in})` or
        :math:`((|\mathcal{V_s}|, F_{in}), (|\mathcal{V_t}|, F_{in}))`
        if bipartite,
        positive edge indices :math:`(2, |\mathcal{E}^{(+)}|)`,
        negative edge indices :math:`(2, |\mathcal{E}^{(-)}|)`
      - **outputs:** node features :math:`(|\mathcal{V}|, F_{out})` or
        :math:`(|\mathcal{V_t}|, F_{out})` if bipartite
class_docstr_tok: ["The","signed","graph","convolutional","operator","from","the","`","``","Signed","Graph","Convolutional","Network","''","<","https",":","\/\/arxiv.org\/abs\/1808.06354",">","`","_","paper",".","..","math",":",":","\\mathbf","{","x","}","_v^","{","(","\\textrm","{","pos","}",")","}","&","=","\\mathbf","{","\\Theta","}","^","{","(","\\textrm","{","pos","}",")","}","\\left","[","\\frac","{","1","}","{","|\\mathcal","{","N","}","^","{","+","}","(","v",")","|","}","\\sum_","{","w","\\in","\\mathcal","{","N","}","^","{","+","}","(","v",")","}","\\mathbf","{","x","}","_w",",","\\mathbf","{","x","}","_v","\\right","]","\\mathbf","{","x","}","_v^","{","(","\\textrm","{","neg","}",")","}","&","=","\\mathbf","{","\\Theta","}","^","{","(","\\textrm","{","neg","}",")","}","\\left","[","\\frac","{","1","}","{","|\\mathcal","{","N","}","^","{","-","}","(","v",")","|","}","\\sum_","{","w","\\in","\\mathcal","{","N","}","^","{","-","}","(","v",")","}","\\mathbf","{","x","}","_w",",","\\mathbf","{","x","}","_v","\\right","]","if",":","obj",":","`","first_aggr","`","is","set","to",":","obj",":","`","True","`",",","and","..","math",":",":","\\mathbf","{","x","}","_v^","{","(","\\textrm","{","pos","}",")","}","&","=","\\mathbf","{","\\Theta","}","^","{","(","\\textrm","{","pos","}",")","}","\\left","[","\\frac","{","1","}","{","|\\mathcal","{","N","}","^","{","+","}","(","v",")","|","}","\\sum_","{","w","\\in","\\mathcal","{","N","}","^","{","+","}","(","v",")","}","\\mathbf","{","x","}","_w^","{","(","\\textrm","{","pos","}",")","}",",","\\frac","{","1","}","{","|\\mathcal","{","N","}","^","{","-","}","(","v",")","|","}","\\sum_","{","w","\\in","\\mathcal","{","N","}","^","{","-","}","(","v",")","}","\\mathbf","{","x","}","_w^","{","(","\\textrm","{","neg","}",")","}",",","\\mathbf","{","x","}","_v^","{","(","\\textrm","{","pos","}",")","}","\\right","]","\\mathbf","{","x","}","_v^","{","(","\\textrm","{","neg","}",")","}","&","=","\\mathbf","{","\\Theta","}","^","{","(","\\textrm","{","pos","}",")","}","\\left","[","\\frac","{","1","}","{","|\\mathcal","{","N","}","^","{","+","}","(","v",")","|","}","\\sum_","{","w","\\in","\\mathcal","{","N","}","^","{","+","}","(","v",")","}","\\mathbf","{","x","}","_w^","{","(","\\textrm","{","neg","}",")","}",",","\\frac","{","1","}","{","|\\mathcal","{","N","}","^","{","-","}","(","v",")","|","}","\\sum_","{","w","\\in","\\mathcal","{","N","}","^","{","-","}","(","v",")","}","\\mathbf","{","x","}","_w^","{","(","\\textrm","{","pos","}",")","}",",","\\mathbf","{","x","}","_v^","{","(","\\textrm","{","neg","}",")","}","\\right","]","otherwise",".","In","case",":","obj",":","`","first_aggr","`","is",":","obj",":","`","False","`",",","the","layer","expects",":","obj",":","`","x","`","to","be","a","tensor","where",":","obj",":","`","x","[",":",",",":","in_channels","]","`","denotes","the","positive","node","features",":","math",":","`","\\mathbf","{","X","}","^","{","(","\\textrm","{","pos","}",")","}","`","and",":","obj",":","`","x","[",":",",","in_channels",":","]","`","denotes","the","negative","node","features",":","math",":","`","\\mathbf","{","X","}","^","{","(","\\textrm","{","neg","}",")","}","`",".","Args",":","in_channels","(","int",")",":","Size","of","each","input","sample",",","or",":","obj",":","`","-1","`","to","derive","the","size","from","the","first","input","(","s",")","to","the","forward","method",".","out_channels","(","int",")",":","Size","of","each","output","sample",".","first_aggr","(","bool",")",":","Denotes","which","aggregation","formula","to","use",".","bias","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","layer","will","not","learn","an","additive","bias",".","(","default",":",":","obj",":","`","True","`",")","*","*","kwargs","(","optional",")",":","Additional","arguments","of",":","class",":","`","torch_geometric.nn.conv.MessagePassing","`",".","Shapes",":","-","*","*","input",":","*","*","node","features",":","math",":","`","(","|\\mathcal","{","V","}","|",",","F_","{","in","}",")","`","or",":","math",":","`","(","(","|\\mathcal","{","V_s","}","|",",","F_","{","in","}",")",",","(","|\\mathcal","{","V_t","}","|",",","F_","{","in","}",")",")","`","if","bipartite",",","positive","edge","indices",":","math",":","`","(","2",",","|\\mathcal","{","E","}","^","{","(","+",")","}","|",")","`",",","negative","edge","indices",":","math",":","`","(","2",",","|\\mathcal","{","E","}","^","{","(","-",")","}","|",")","`","-","*","*","outputs",":","*","*","node","features",":","math",":","`","(","|\\mathcal","{","V","}","|",",","F_","{","out","}",")","`","or",":","math",":","`","(","|\\mathcal","{","V_t","}","|",",","F_","{","out","}",")","`","if","bipartite"]
code: def message_and_aggregate(self, adj_t: Adj, x: PairTensor) -> Tensor:
      if isinstance(adj_t, SparseTensor):
          adj_t = adj_t.set_value(None, layout=None)
      return spmm(adj_t, x[0], reduce=self.aggr)
  
file_path: pytorch_geometric/torch_geometric/nn/conv/signed_conv.py
imports: from typing import Union
  import torch
  from torch import Tensor
  from torch_geometric.nn.conv import MessagePassing
  from torch_geometric.nn.dense.linear import Linear
  from torch_geometric.typing import Adj, PairTensor, SparseTensor
  from torch_geometric.utils import spmm
label_desc: Use image node_id 5 for calling the SignedConv obj's underlying member method code with example usage: obj.message_and_aggregate(adj_t, x) and returns: spmm