class_docstr: An implementation of the Multivariate Time Series Forecasting Graph Neural Networks.
  For details see this paper: `"Connecting the Dots: Multivariate Time Series Forecasting with Graph Neural Networks."
  <https://arxiv.org/pdf/2005.11650.pdf>`_
  
  Args:
      gcn_true (bool): Whether to add graph convolution layer.
      build_adj (bool): Whether to construct adaptive adjacency matrix.
      gcn_depth (int): Graph convolution depth.
      num_nodes (int): Number of nodes in the graph.
      kernel_set (list of int): List of kernel sizes.
      kernel_size (int): Size of kernel for convolution, to calculate receptive field size.
      dropout (float): Droupout rate.
      subgraph_size (int): Size of subgraph.
      node_dim (int): Dimension of nodes.
      dilation_exponential (int): Dilation exponential.
      conv_channels (int): Convolution channels.
      residual_channels (int): Residual channels.
      skip_channels (int): Skip channels.
      end_channels (int): End channels.
      seq_length (int): Length of input sequence.
      in_dim (int): Input dimension.
      out_dim (int): Output dimension.
      layers (int): Number of layers.
      propalpha (float): Prop alpha, ratio of retaining the root nodes's original states in mix-hop propagation, a value between 0 and 1.
      tanhalpha (float): Tanh alpha for generating adjacency matrix, alpha controls the saturation rate.
      layer_norm_affline (bool): Whether to do elementwise affine in Layer Normalization.
      xd (int, optional): Static feature dimension, default None.
class_docstr_tok: ["An","implementation","of","the","Multivariate","Time","Series","Forecasting","Graph","Neural","Networks",".","For","details","see","this","paper",":","`","``","Connecting","the","Dots",":","Multivariate","Time","Series","Forecasting","with","Graph","Neural","Networks",".","''","<","https",":","\/\/arxiv.org\/pdf\/2005.11650.pdf",">","`","_","Args",":","gcn_true","(","bool",")",":","Whether","to","add","graph","convolution","layer",".","build_adj","(","bool",")",":","Whether","to","construct","adaptive","adjacency","matrix",".","gcn_depth","(","int",")",":","Graph","convolution","depth",".","num_nodes","(","int",")",":","Number","of","nodes","in","the","graph",".","kernel_set","(","list","of","int",")",":","List","of","kernel","sizes",".","kernel_size","(","int",")",":","Size","of","kernel","for","convolution",",","to","calculate","receptive","field","size",".","dropout","(","float",")",":","Droupout","rate",".","subgraph_size","(","int",")",":","Size","of","subgraph",".","node_dim","(","int",")",":","Dimension","of","nodes",".","dilation_exponential","(","int",")",":","Dilation","exponential",".","conv_channels","(","int",")",":","Convolution","channels",".","residual_channels","(","int",")",":","Residual","channels",".","skip_channels","(","int",")",":","Skip","channels",".","end_channels","(","int",")",":","End","channels",".","seq_length","(","int",")",":","Length","of","input","sequence",".","in_dim","(","int",")",":","Input","dimension",".","out_dim","(","int",")",":","Output","dimension",".","layers","(","int",")",":","Number","of","layers",".","propalpha","(","float",")",":","Prop","alpha",",","ratio","of","retaining","the","root","nodes","'s","original","states","in","mix-hop","propagation",",","a","value","between","0","and","1.","tanhalpha","(","float",")",":","Tanh","alpha","for","generating","adjacency","matrix",",","alpha","controls","the","saturation","rate",".","layer_norm_affline","(","bool",")",":","Whether","to","do","elementwise","affine","in","Layer","Normalization",".","xd","(","int",",","optional",")",":","Static","feature","dimension",",","default","None","."]
docstr: Making a forward pass of MTGNN.
  
  Arg types:
      * **X_in** (PyTorch FloatTensor) - Input sequence, with shape (batch_size, in_dim, num_nodes, seq_len).
      * **A_tilde** (Pytorch FloatTensor, optional) - Predefined adjacency matrix, default None.
      * **idx** (Pytorch LongTensor, optional) - Input indices, a permutation of the num_nodes, default None (no permutation).
      * **FE** (Pytorch FloatTensor, optional) - Static feature, default None.
  
  Return types:
      * **X** (PyTorch FloatTensor) - Output sequence for prediction, with shape (batch_size, seq_len, num_nodes, 1).
code: def forward(
      self,
      X_in: torch.FloatTensor,
      A_tilde: Optional[torch.FloatTensor] = None,
      idx: Optional[torch.LongTensor] = None,
      FE: Optional[torch.FloatTensor] = None,
  ) -> torch.FloatTensor:
      """
      Making a forward pass of MTGNN.
  
      Arg types:
          * **X_in** (PyTorch FloatTensor) - Input sequence, with shape (batch_size, in_dim, num_nodes, seq_len).
          * **A_tilde** (Pytorch FloatTensor, optional) - Predefined adjacency matrix, default None.
          * **idx** (Pytorch LongTensor, optional) - Input indices, a permutation of the num_nodes, default None (no permutation).
          * **FE** (Pytorch FloatTensor, optional) - Static feature, default None.
  
      Return types:
          * **X** (PyTorch FloatTensor) - Output sequence for prediction, with shape (batch_size, seq_len, num_nodes, 1).
      """
      seq_len = X_in.size(3)
      assert (
          seq_len == self._seq_length
      ), "Input sequence length not equal to preset sequence length."
  
      if self._seq_length < self._receptive_field:
          X_in = nn.functional.pad(
              X_in, (self._receptive_field - self._seq_length, 0, 0, 0)
          )
  
      if self._gcn_true:
          if self._build_adj_true:
              if idx is None:
                  A_tilde = self._graph_constructor(
                      self._idx.to(X_in.device), FE=FE
                  )
              else:
                  A_tilde = self._graph_constructor(idx, FE=FE)
  
      X = self._start_conv(X_in)
      X_skip = self._skip_conv_0(
          F.dropout(X_in, self._dropout, training=self.training)
      )
      if idx is None:
          for mtgnn in self._mtgnn_layers:
              X, X_skip = mtgnn(
                  X,
                  X_skip,
                  A_tilde,
                  self._idx.to(X_in.device),
                  self.training,
              )
      else:
          for mtgnn in self._mtgnn_layers:
              X, X_skip = mtgnn(X, X_skip, A_tilde, idx, self.training)
  
      X_skip = self._skip_conv_E(X) + X_skip
      X = F.relu(X_skip)
      X = F.relu(self._end_conv_1(X))
      X = self._end_conv_2(X)
      return X
  
imports: from __future__ import division
  import numbers
  from typing import Optional
  import torch
  import torch.nn
  from torch.nn import init
  import torch.nn.functional
label_desc: Use image node_id 5 for calling the MTGNN obj's underlying member method code with example usage: obj.forward(X_in, A_tilde, idx, FE) and returns: X