class_docstr: A unified wrapper for `GraphSAGE Network <https://arxiv.org/pdf/1706.02216.pdf>`
  Support both unidirectional (i.e., regular) and bidirectional (i.e., `bi_sep` and `bi_fuse`)
  versions.
  
  .. math::
      h_{\mathcal{N}(i)}^{(l+1)} & = \mathrm{aggregate}
      \left(\{h_{j}^{l}, \forall j \in \mathcal{N}(i) \}\right)
      h_{i}^{(l+1)} & = \sigma \left(W \cdot \mathrm{concat}
      (h_{i}^{l}, h_{\mathcal{N}(i)}^{l+1} + b) \right)
      h_{i}^{(l+1)} & = \mathrm{norm}(h_{i}^{l})
  
  Parameters
  ----------
  input_size : int, or pair of ints
      Input feature size.
      If the layer is to be applied to a unidirectional bipartite graph, ``input_size``
      specifies the input feature size on both the source and destination nodes.  If
      a scalar is given, the source and destination node feature size would take the
      same value.
  output_size : int
      Output feature size.
  direction_option: str
      Whether use unidirectional (i.e., 'undirected') or bidirectional (i.e., `bi_sep`
      and `bi_fuse`) versions.
  feat_drop : float, optional
      Dropout rate on feature, defaults: ``0``.
  aggregator_type : str
      Aggregator type to use (``mean``, ``gcn``, ``pool``, ``lstm``).
  bias : bool
      If True, adds a learnable bias to the output. Default: ``True``.
  norm : callable activation function/layer or None, optional
      If not None, applies normalization to the updated node features.
  activation : callable activation function/layer or None, optional
      If not None, applies an activation function to the updated node features.
      Default: ``None``.
class_docstr_tok: ["A","unified","wrapper","for","`","GraphSAGE","Network","<","https",":","\/\/arxiv.org\/pdf\/1706.02216.pdf",">","`","Support","both","unidirectional","(","i.e.",",","regular",")","and","bidirectional","(","i.e.",",","`","bi_sep","`","and","`","bi_fuse","`",")","versions",".","..","math",":",":","h_","{","\\mathcal","{","N","}","(","i",")","}","^","{","(","l+1",")","}","&","=","\\mathrm","{","aggregate","}","\\left","(","\\","{","h_","{","j","}","^","{","l","}",",","\\forall","j","\\in","\\mathcal","{","N","}","(","i",")","\\","}","\\right",")","h_","{","i","}","^","{","(","l+1",")","}","&","=","\\sigma","\\left","(","W","\\cdot","\\mathrm","{","concat","}","(","h_","{","i","}","^","{","l","}",",","h_","{","\\mathcal","{","N","}","(","i",")","}","^","{","l+1","}","+","b",")","\\right",")","h_","{","i","}","^","{","(","l+1",")","}","&","=","\\mathrm","{","norm","}","(","h_","{","i","}","^","{","l","}",")","Parameters","--","--","--","--","--","input_size",":","int",",","or","pair","of","ints","Input","feature","size",".","If","the","layer","is","to","be","applied","to","a","unidirectional","bipartite","graph",",","``","input_size","``","specifies","the","input","feature","size","on","both","the","source","and","destination","nodes",".","If","a","scalar","is","given",",","the","source","and","destination","node","feature","size","would","take","the","same","value",".","output_size",":","int","Output","feature","size",".","direction_option",":","str","Whether","use","unidirectional","(","i.e.",",","'undirected","'",")","or","bidirectional","(","i.e.",",","`","bi_sep","`","and","`","bi_fuse","`",")","versions",".","feat_drop",":","float",",","optional","Dropout","rate","on","feature",",","defaults",":","``","0","``",".","aggregator_type",":","str","Aggregator","type","to","use","(","``","mean","``",",","``","gcn","``",",","``","pool","``",",","``","lstm","``",")",".","bias",":","bool","If","True",",","adds","a","learnable","bias","to","the","output",".","Default",":","``","True","``",".","norm",":","callable","activation","function\/layer","or","None",",","optional","If","not","None",",","applies","normalization","to","the","updated","node","features",".","activation",":","callable","activation","function\/layer","or","None",",","optional","If","not","None",",","applies","an","activation","function","to","the","updated","node","features",".","Default",":","``","None","``","."]
code: def __init__(
      self,
      input_size,
      output_size,
      aggregator_type,
      direction_option="undirected",
      feat_drop=0.0,
      bias=True,
      norm=None,
      activation=None,
  ):
      super(GraphSAGELayer, self).__init__()
      if direction_option == "undirected":
          self.model = UndirectedGraphSAGELayerConv(
              input_size,
              output_size,
              aggregator_type,
              feat_drop=feat_drop,
              bias=bias,
              norm=norm,
              activation=activation,
          )
      elif direction_option == "bi_sep":
          self.model = BiSepGraphSAGELayerConv(
              input_size,
              output_size,
              aggregator_type,
              feat_drop=feat_drop,
              bias=bias,
              norm=norm,
              activation=activation,
          )
      elif direction_option == "bi_fuse":
          self.model = BiFuseGraphSAGELayerConv(
              input_size,
              output_size,
              aggregator_type,
              feat_drop=feat_drop,
              bias=bias,
              norm=norm,
              activation=activation,
          )
      else:
          raise RuntimeError(
              "Unknown `direction_option` value: {}".format(
                  direction_option
              )
          )
  
imports: import warnings
  import dgl.function
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.utils import check_eq_shape, expand_as_pair
  from .base import GNNBase, GNNLayerBase
label_desc: Use image node_id 1 to create a new GraphSAGELayer object from inherited base classes: GNNLayerBase with example: obj = GraphSAGELayer(input_size, output_size, aggregator_type, direction_option, feat_drop, bias, norm, activation)