class_docstr: A graph convolutional network(GCN) for either classification or regression.
  The network consists of the following sequence of layers:
  
  - Weave feature modules
  
  - Final convolution
  
  - Weave Gather Layer
  
  - A fully connected layer
  
  - A Softmax layer
  
  Example
  --------
  >>> import numpy as np
  >>> import deepchem as dc
  >>> featurizer = dc.feat.WeaveFeaturizer()
  >>> X = featurizer(["C", "CC"])
  >>> y = np.array([1, 0])
  >>> batch_size = 2
  >>> weavemodel = dc.models.WeaveModel(n_tasks=1,n_weave=2, fully_connected_layer_sizes=[2000, 1000],mode="classification",batch_size=batch_size)
  >>> atom_feat, pair_feat, pair_split, atom_split, atom_to_pair = weavemodel.compute_features_on_batch(X)
  >>> model = Weave(n_tasks=1,n_weave=2,fully_connected_layer_sizes=[2000, 1000],mode="classification")
  >>> input_data = [atom_feat, pair_feat, pair_split, atom_split, atom_to_pair]
  >>> output = model(input_data)
  
  References
  ----------
  .. [1] Kearnes, Steven, et al. "Molecular graph convolutions: moving beyond
      fingerprints." Journal of computer-aided molecular design 30.8 (2016):
      595-608.
class_docstr_tok: ["A","graph","convolutional","network","(","GCN",")","for","either","classification","or","regression",".","The","network","consists","of","the","following","sequence","of","layers",":","-","Weave","feature","modules","-","Final","convolution","-","Weave","Gather","Layer","-","A","fully","connected","layer","-","A","Softmax","layer","Example","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","import","deepchem","as","dc",">",">",">","featurizer","=","dc.feat.WeaveFeaturizer","(",")",">",">",">","X","=","featurizer","(","[","``","C","''",",","``","CC","''","]",")",">",">",">","y","=","np.array","(","[","1",",","0","]",")",">",">",">","batch_size","=","2",">",">",">","weavemodel","=","dc.models.WeaveModel","(","n_tasks=1",",","n_weave=2",",","fully_connected_layer_sizes=","[","2000",",","1000","]",",","mode=","''","classification","''",",","batch_size=batch_size",")",">",">",">","atom_feat",",","pair_feat",",","pair_split",",","atom_split",",","atom_to_pair","=","weavemodel.compute_features_on_batch","(","X",")",">",">",">","model","=","Weave","(","n_tasks=1",",","n_weave=2",",","fully_connected_layer_sizes=","[","2000",",","1000","]",",","mode=","''","classification","''",")",">",">",">","input_data","=","[","atom_feat",",","pair_feat",",","pair_split",",","atom_split",",","atom_to_pair","]",">",">",">","output","=","model","(","input_data",")","References","--","--","--","--","--","..","[","1","]","Kearnes",",","Steven",",","et","al",".","``","Molecular","graph","convolutions",":","moving","beyond","fingerprints",".","''","Journal","of","computer-aided","molecular","design","30.8","(","2016",")",":","595-608","."]
docstr: Parameters
  ----------
  inputs: OneOrMany[torch.Tensor]
      Should contain 5 tensors [atom_features, pair_features, pair_split, atom_split, atom_to_pair]
  
  Returns
  -------
  List[torch.Tensor]
      Output as per use case : regression/classification
docstr_tok: ["Parameters","--","--","--","--","--","inputs",":","OneOrMany","[","torch.Tensor","]","Should","contain","5","tensors","[","atom_features",",","pair_features",",","pair_split",",","atom_split",",","atom_to_pair","]","Returns","--","--","--","-","List","[","torch.Tensor","]","Output","as","per","use","case",":","regression\/classification"]
code: def forward(
      self, inputs: OneOrMany[torch.Tensor]
  ) -> List[torch.Tensor]:
      """
      Parameters
      ----------
      inputs: OneOrMany[torch.Tensor]
          Should contain 5 tensors [atom_features, pair_features, pair_split, atom_split, atom_to_pair]
  
      Returns
      -------
      List[torch.Tensor]
          Output as per use case : regression/classification
      """
      input1: List[np.ndarray] = [
          np.array(inputs[0]),
          np.array(inputs[1]),
          np.array(inputs[2]),
          np.array(inputs[4]),
      ]
      for ind in range(self.n_weave):
          weave_layer_ind_A, weave_layer_ind_P = self.layers[ind](
              input1
          )
          input1 = [
              weave_layer_ind_A,
              weave_layer_ind_P,
              np.array(inputs[2]),
              np.array(inputs[4]),
          ]
  
      dense1: torch.Tensor = self.dense1(weave_layer_ind_A)
      dense1 = self.dense1_act(dense1)
      if self.batch_normalize:
          self.dense1_bn.eval()
          dense1 = self.dense1_bn(dense1)
  
      weave_gather: torch.Tensor = self.weave_gather(
          [dense1, inputs[3]]
      )
      if self.n_layers > 0:
          input_layer: torch.Tensor = weave_gather
          for ind, dropout in zip([0, 1], self.dropouts):
              dense2 = self.layers2[ind]
              layer = self.layers2[ind](input_layer)
              if dropout > 0.0:
                  dense2.dropout.eval()
                  layer = dense2.dropout(layer)
              if self.batch_normalize:
                  dense2.layer_bn.eval()
                  layer = dense2.layer_bn(layer)
              layer = dense2.layer_act(layer)
              input_layer = layer
          output: torch.Tensor = input_layer
      else:
          output = weave_gather
  
      n_tasks = self.n_tasks
      if self.mode == "classification":
          n_classes = self.n_classes
          logits: torch.Tensor = torch.reshape(
              self.layer_2(output), (-1, n_tasks, n_classes)
          )
          output = F.softmax(logits, dim=2)
          outputs: List[torch.Tensor] = [output, logits]
      else:
          output = self.layer_2(output)
          outputs = [output]
  
      return outputs
  
file_path: deepchem/deepchem/models/torch_models/weavemodel_pytorch.py
imports: import numpy
  from collections.abc import Sequence
  from typing import List, Tuple, Iterable, Optional, Callable, Union, Sequence
  from deepchem.data import Dataset
  from deepchem.metrics import to_one_hot
  from deepchem.utils.typing import OneOrMany, ActivationFn
  from deepchem.models.losses import L2Loss, SoftmaxCrossEntropy
  from deepchem.models.torch_models.torch_model import TorchModel
  import deepchem.models.torch_models.layers
  from deepchem.utils.pytorch_utils import get_activation
label_desc: Use image node_id 2 for calling the Weave obj's underlying member method code with example usage: obj.forward(inputs) and returns: outputs