" "Run 'pip install jinja2' to install the library." ) input_args = if not isinstance ( modules, dict ): modules = ' module_repr = template. """ try : from jinja2 import Template except ImportError : raise ModuleNotFoundError ( "No module named 'jinja2' found on this machine. Alternatively, an :obj:`OrderedDict` of modules (and function header definitions) can be passed. modules (): A list of modules (with optional function header definitions). code-block:: python from torch.nn import Linear, ReLU, Dropout from torch_geometric.nn import Sequential, GCNConv, JumpingKnowledge from torch_geometric.nn import global_mean_pool model = Sequential('x, edge_index, batch',, 'x1, x2 -> xs'), (JumpingKnowledge("cat", 64, num_layers=2), 'xs -> x'), (global_mean_pool, 'x, batch -> x'), Linear(2 * 64, dataset.num_classes), ]) Args: input_args (str): The input arguments of the model. In particular, this also allows to create more sophisticated models, such as utilizing :class:`~torch_geometric.nn.models.JumpingKnowledge`. code-block:: python from torch.nn import Linear, ReLU from torch_geometric.nn import Sequential, GCNConv model = Sequential('x, edge_index', ) where :obj:`'x, edge_index'` defines the input arguments of :obj:`model`, and :obj:`'x, edge_index -> x'` defines the function header, *i.e.* input arguments *and* return types, of :class:`~torch_geometric.nn.conv.GCNConv`. If omitted, an intermediate module will operate on the *output* of its preceding module. Since GNN operators take in multiple input arguments, :class:`torch_geometric.nn.Sequential` expects both global input arguments, and function header definitions of individual operators. Module : r """An extension of the :class:`torch.nn.Sequential` container in order to define a sequential GNN model.
Def Sequential ( input_args : str, modules : List, Callable ]], ) -> torch.