class_docstr: An implementation of the Diffusion Convolution Layer.
  For details see: `"Diffusion Convolutional Recurrent Neural Network:
  Data-Driven Traffic Forecasting" <https://arxiv.org/abs/1707.01926>`_
  
  Args:
      in_channels (int): Number of input features.
      out_channels (int): Number of output features.
      K (int): Filter size :math:`K`.
      bias (bool, optional): If set to :obj:`False`, the layer
          will not learn an additive bias (default :obj:`True`).
docstr: Making a forward pass. If edge weights are not present the forward pass
  defaults to an unweighted graph.
  
  Arg types:
      * **X** (PyTorch Float Tensor) - Node features.
      * **edge_index** (PyTorch Long Tensor) - Graph edge indices.
      * **edge_weight** (PyTorch Long Tensor, optional) - Edge weight vector.
  
  Return types:
      * **H** (PyTorch Float Tensor) - Hidden state matrix for all nodes.
docstr_tok: ["Making","a","forward","pass",".","If","edge","weights","are","not","present","the","forward","pass","defaults","to","an","unweighted","graph",".","Arg","types",":","*","*","*","X","*","*","(","PyTorch","Float","Tensor",")","-","Node","features",".","*","*","*","edge_index","*","*","(","PyTorch","Long","Tensor",")","-","Graph","edge","indices",".","*","*","*","edge_weight","*","*","(","PyTorch","Long","Tensor",",","optional",")","-","Edge","weight","vector",".","Return","types",":","*","*","*","H","*","*","(","PyTorch","Float","Tensor",")","-","Hidden","state","matrix","for","all","nodes","."]
code: def forward(
      self,
      X: torch.FloatTensor,
      edge_index: torch.LongTensor,
      edge_weight: torch.FloatTensor,
  ) -> torch.FloatTensor:
      r"""Making a forward pass. If edge weights are not present the forward pass
      defaults to an unweighted graph.
  
      Arg types:
          * **X** (PyTorch Float Tensor) - Node features.
          * **edge_index** (PyTorch Long Tensor) - Graph edge indices.
          * **edge_weight** (PyTorch Long Tensor, optional) - Edge weight vector.
  
      Return types:
          * **H** (PyTorch Float Tensor) - Hidden state matrix for all nodes.
      """
      adj_mat = to_dense_adj(edge_index, edge_attr=edge_weight)
      adj_mat = adj_mat.reshape(adj_mat.size(1), adj_mat.size(2))
      deg_out = torch.matmul(
          adj_mat, torch.ones(size=(adj_mat.size(0), 1)).to(X.device)
      )
      deg_out = deg_out.flatten()
      deg_in = torch.matmul(
          torch.ones(size=(1, adj_mat.size(0))).to(X.device), adj_mat
      )
      deg_in = deg_in.flatten()
  
      deg_out_inv = torch.reciprocal(deg_out)
      deg_in_inv = torch.reciprocal(deg_in)
      row, col = edge_index
      norm_out = deg_out_inv[row]
      norm_in = deg_in_inv[row]
  
      reverse_edge_index = adj_mat.transpose(0, 1)
      reverse_edge_index, vv = dense_to_sparse(reverse_edge_index)
  
      Tx_0 = X
      Tx_1 = X
      H = torch.matmul(Tx_0, (self.weight[0])[0]) + torch.matmul(
          Tx_0, (self.weight[1])[0]
      )
  
      if self.weight.size(1) > 1:
          Tx_1_o = self.propagate(
              edge_index, x=X, norm=norm_out, size=None
          )
          Tx_1_i = self.propagate(
              reverse_edge_index, x=X, norm=norm_in, size=None
          )
          H = (
              H
              + torch.matmul(Tx_1_o, (self.weight[0])[1])
              + torch.matmul(Tx_1_i, (self.weight[1])[1])
          )
  
      for k in range(2, self.weight.size(1)):
          Tx_2_o = self.propagate(
              edge_index, x=Tx_1_o, norm=norm_out, size=None
          )
          Tx_2_o = 2.0 * Tx_2_o - Tx_0
          Tx_2_i = self.propagate(
              reverse_edge_index, x=Tx_1_i, norm=norm_in, size=None
          )
          Tx_2_i = 2.0 * Tx_2_i - Tx_0
          H = (
              H
              + torch.matmul(Tx_2_o, (self.weight[0])[k])
              + torch.matmul(Tx_2_i, (self.weight[1])[k])
          )
          Tx_0, Tx_1_o, Tx_1_i = Tx_1, Tx_2_o, Tx_2_i
  
      if self.bias is not None:
          H += self.bias
  
      return H
  
imports: import math
  import torch
  from torch_geometric.utils import to_dense_adj, dense_to_sparse
  from torch_geometric.nn.conv import MessagePassing
label_desc: Use image node_id 4 for calling the DConv obj's underlying member method code with example usage: obj.forward(X, edge_index, edge_weight) and returns: H