class_docstr: The convolutional layer of CGCNN.
  
  This class was implemented using DGLGraph methods.
  Please confirm how to use DGLGraph methods from below link.
  See: https://docs.dgl.ai/en/0.4.x/tutorials/models/1_gnn/9_gat.html
  
  Examples
  --------
  >>> import deepchem as dc
  >>> from pymatgen.core import Lattice, Structure
  >>> lattice = Lattice.cubic(4.2)
  >>> structure = Structure(lattice, ["Cs", "Cl"], [[0, 0, 0], [0.5, 0.5, 0.5]])
  >>> featurizer = dc.feat.CGCNNFeaturizer()
  >>> cgcnn_graph = featurizer.featurize([structure])[0]
  >>> cgcnn_graph.num_node_features
  92
  >>> cgcnn_graph.num_edge_features
  41
  >>> cgcnn_dgl_graph = cgcnn_graph.to_dgl_graph()
  >>> print(type(cgcnn_dgl_graph))
  <class 'dgl.heterograph.DGLGraph'>
  >>> layer = CGCNNLayer(hidden_node_dim=92, edge_dim=41)
  >>> node_feats = cgcnn_dgl_graph.ndata.pop('x')
  >>> edge_feats = cgcnn_dgl_graph.edata.pop('edge_attr')
  >>> new_node_feats, new_edge_feats = layer(cgcnn_dgl_graph, node_feats, edge_feats)
  
  Notes
  -----
  This class requires DGL and PyTorch to be installed.
class_docstr_tok: ["The","convolutional","layer","of","CGCNN",".","This","class","was","implemented","using","DGLGraph","methods",".","Please","confirm","how","to","use","DGLGraph","methods","from","below","link",".","See",":","https",":","\/\/docs.dgl.ai\/en\/0.4.x\/tutorials\/models\/1_gnn\/9_gat.html","Examples","--","--","--","--",">",">",">","import","deepchem","as","dc",">",">",">","from","pymatgen.core","import","Lattice",",","Structure",">",">",">","lattice","=","Lattice.cubic","(","4.2",")",">",">",">","structure","=","Structure","(","lattice",",","[","``","Cs","''",",","``","Cl","''","]",",","[","[","0",",","0",",","0","]",",","[","0.5",",","0.5",",","0.5","]","]",")",">",">",">","featurizer","=","dc.feat.CGCNNFeaturizer","(",")",">",">",">","cgcnn_graph","=","featurizer.featurize","(","[","structure","]",")","[","0","]",">",">",">","cgcnn_graph.num_node_features","92",">",">",">","cgcnn_graph.num_edge_features","41",">",">",">","cgcnn_dgl_graph","=","cgcnn_graph.to_dgl_graph","(",")",">",">",">","print","(","type","(","cgcnn_dgl_graph",")",")","<","class","'dgl.heterograph.DGLGraph","'",">",">",">",">","layer","=","CGCNNLayer","(","hidden_node_dim=92",",","edge_dim=41",")",">",">",">","node_feats","=","cgcnn_dgl_graph.ndata.pop","(","'","x","'",")",">",">",">","edge_feats","=","cgcnn_dgl_graph.edata.pop","(","'edge_attr","'",")",">",">",">","new_node_feats",",","new_edge_feats","=","layer","(","cgcnn_dgl_graph",",","node_feats",",","edge_feats",")","Notes","--","--","-","This","class","requires","DGL","and","PyTorch","to","be","installed","."]
docstr: Parameters
  ----------
  hidden_node_dim: int
      The length of the hidden node feature vectors.
  edge_dim: int
      The length of the edge feature vectors.
  batch_norm: bool, default True
      Whether to apply batch normalization or not.
docstr_tok: ["Parameters","--","--","--","--","--","hidden_node_dim",":","int","The","length","of","the","hidden","node","feature","vectors",".","edge_dim",":","int","The","length","of","the","edge","feature","vectors",".","batch_norm",":","bool",",","default","True","Whether","to","apply","batch","normalization","or","not","."]
code: def __init__(
      self, hidden_node_dim: int, edge_dim: int, batch_norm: bool = True
  ):
      """
      Parameters
      ----------
      hidden_node_dim: int
          The length of the hidden node feature vectors.
      edge_dim: int
          The length of the edge feature vectors.
      batch_norm: bool, default True
          Whether to apply batch normalization or not.
      """
      super(CGCNNLayer, self).__init__()
      z_dim = 2 * hidden_node_dim + edge_dim
      liner_out_dim = 2 * hidden_node_dim
      self.linear = nn.Linear(z_dim, liner_out_dim)
      self.batch_norm = (
          nn.BatchNorm1d(liner_out_dim) if batch_norm else None
      )
  
file_path: deepchem/deepchem/models/torch_models/cgcnn.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from deepchem.models.losses import Loss, L2Loss, SparseSoftmaxCrossEntropy
  from deepchem.models.torch_models.torch_model import TorchModel
label_desc: Use image node_id 1 to create a new CGCNNLayer object from inherited base classes: nn with example: obj = CGCNNLayer(hidden_node_dim, edge_dim, batch_norm)