class_docstr: Spatio-temporal convolution block using ChebConv Graph Convolutions.
  For details see: `"Spatio-Temporal Graph Convolutional Networks:
  A Deep Learning Framework for Traffic Forecasting"
  <https://arxiv.org/abs/1709.04875>`_
  
  NB. The ST-Conv block contains two temporal convolutions (TemporalConv)
  with kernel size k. Hence for an input sequence of length m,
  the output sequence will be length m-2(k-1).
  
  Args:
      in_channels (int): Number of input features.
      hidden_channels (int): Number of hidden units output by graph convolution block
      out_channels (int): Number of output features.
      kernel_size (int): Size of the kernel considered.
      K (int): Chebyshev filter size :math:`K`.
      normalization (str, optional): The normalization scheme for the graph
          Laplacian (default: :obj:`"sym"`):
  
          1. :obj:`None`: No normalization
          :math:`\mathbf{L} = \mathbf{D} - \mathbf{A}`
  
          2. :obj:`"sym"`: Symmetric normalization
          :math:`\mathbf{L} = \mathbf{I} - \mathbf{D}^{-1/2} \mathbf{A}
          \mathbf{D}^{-1/2}`
  
          3. :obj:`"rw"`: Random-walk normalization
          :math:`\mathbf{L} = \mathbf{I} - \mathbf{D}^{-1} \mathbf{A}`
  
          You need to pass :obj:`lambda_max` to the :meth:`forward` method of
          this operator in case the normalization is non-symmetric.
          :obj:`\lambda_max` should be a :class:`torch.Tensor` of size
          :obj:`[num_graphs]` in a mini-batch scenario and a
          scalar/zero-dimensional tensor when operating on single graphs.
          You can pre-compute :obj:`lambda_max` via the
          :class:`torch_geometric.transforms.LaplacianLambdaMax` transform.
      bias (bool, optional): If set to :obj:`False`, the layer will not learn
          an additive bias. (default: :obj:`True`)
class_docstr_tok: ["Spatio-temporal","convolution","block","using","ChebConv","Graph","Convolutions",".","For","details","see",":","`","``","Spatio-Temporal","Graph","Convolutional","Networks",":","A","Deep","Learning","Framework","for","Traffic","Forecasting","''","<","https",":","\/\/arxiv.org\/abs\/1709.04875",">","`","_","NB",".","The","ST-Conv","block","contains","two","temporal","convolutions","(","TemporalConv",")","with","kernel","size","k.","Hence","for","an","input","sequence","of","length","m",",","the","output","sequence","will","be","length","m-2","(","k-1",")",".","Args",":","in_channels","(","int",")",":","Number","of","input","features",".","hidden_channels","(","int",")",":","Number","of","hidden","units","output","by","graph","convolution","block","out_channels","(","int",")",":","Number","of","output","features",".","kernel_size","(","int",")",":","Size","of","the","kernel","considered",".","K","(","int",")",":","Chebyshev","filter","size",":","math",":","`","K","`",".","normalization","(","str",",","optional",")",":","The","normalization","scheme","for","the","graph","Laplacian","(","default",":",":","obj",":","`","``","sym","''","`",")",":","1.",":","obj",":","`","None","`",":","No","normalization",":","math",":","`","\\mathbf","{","L","}","=","\\mathbf","{","D","}","-","\\mathbf","{","A","}","`","2.",":","obj",":","`","``","sym","''","`",":","Symmetric","normalization",":","math",":","`","\\mathbf","{","L","}","=","\\mathbf","{","I","}","-","\\mathbf","{","D","}","^","{","-1\/2","}","\\mathbf","{","A","}","\\mathbf","{","D","}","^","{","-1\/2","}","`","3.",":","obj",":","`","``","rw","''","`",":","Random-walk","normalization",":","math",":","`","\\mathbf","{","L","}","=","\\mathbf","{","I","}","-","\\mathbf","{","D","}","^","{","-1","}","\\mathbf","{","A","}","`","You","need","to","pass",":","obj",":","`","lambda_max","`","to","the",":","meth",":","`","forward","`","method","of","this","operator","in","case","the","normalization","is","non-symmetric",".",":","obj",":","`","\\lambda_max","`","should","be","a",":","class",":","`","torch.Tensor","`","of","size",":","obj",":","`","[","num_graphs","]","`","in","a","mini-batch","scenario","and","a","scalar\/zero-dimensional","tensor","when","operating","on","single","graphs",".","You","can","pre-compute",":","obj",":","`","lambda_max","`","via","the",":","class",":","`","torch_geometric.transforms.LaplacianLambdaMax","`","transform",".","bias","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","layer","will","not","learn","an","additive","bias",".","(","default",":",":","obj",":","`","True","`",")"]
code: def __init__(
      self,
      num_nodes: int,
      in_channels: int,
      hidden_channels: int,
      out_channels: int,
      kernel_size: int,
      K: int,
      normalization: str = "sym",
      bias: bool = True,
  ):
      super(STConv, self).__init__()
      self.num_nodes = num_nodes
      self.in_channels = in_channels
      self.hidden_channels = hidden_channels
      self.out_channels = out_channels
      self.kernel_size = kernel_size
      self.K = K
      self.normalization = normalization
      self.bias = bias
  
      self._temporal_conv1 = TemporalConv(
          in_channels=in_channels,
          out_channels=hidden_channels,
          kernel_size=kernel_size,
      )
  
      self._graph_conv = ChebConv(
          in_channels=hidden_channels,
          out_channels=hidden_channels,
          K=K,
          normalization=normalization,
          bias=bias,
      )
  
      self._temporal_conv2 = TemporalConv(
          in_channels=hidden_channels,
          out_channels=out_channels,
          kernel_size=kernel_size,
      )
  
      self._batch_norm = nn.BatchNorm2d(num_nodes)
  
file_path: pytorch_geometric_temporal/torch_geometric_temporal/nn/attention/stgcn.py
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from torch_geometric.nn import ChebConv
label_desc: Use image node_id 1 to create a new STConv object from inherited base classes: nn with example: obj = STConv(num_nodes, in_channels, hidden_channels, out_channels, kernel_size, K, normalization, bias)