class_docstr: Convolution together with iteratively reweighting least squre from
  `Graph Neural Networks Inspired by Classical Iterative Algorithms
  <https://arxiv.org/pdf/2103.06064.pdf>`__
  
  Parameters
  ----------
  input_d : int
      Number of input features.
  output_d : int
      Number of output features.
  hidden_d : int
      Size of hidden layers.
  prop_step : int
      Number of propagation steps
  num_mlp_before : int
      Number of mlp layers before propagation. Default: ``1``.
  num_mlp_after : int
      Number of mlp layers after propagation.  Default: ``1``.
  norm : str
      The type of norm layers inside mlp layers. Can be ``'batch'``, ``'layer'`` or ``'none'``.
      Default: ``'none'``
  precond : str
      If True, use pre conditioning and unormalized laplacian, else not use pre conditioning
      and use normalized laplacian. Default: ``True``
  alp : float
      The :math:`\alpha` in paper. If equal to :math:`0`, will be automatically decided based
      on other hyper prameters. Default: ``0``.
  lam : float
      The :math:`\lambda` in paper. Default: ``1``.
  attention : bool
      If ``True``, add an attention layer inside propagations. Default: ``False``.
  tau : float
      The :math:`\tau` in paper. Default: ``0.2``.
  T : float
      The :math:`T` in paper. If < 0, :math:`T` will be set to `\infty`. Default: ``-1``.
  p : float
      The :math:`p` in paper. Default: ``1``.
  use_eta : bool
      If ``True``, add a learnable weight on each dimension in attention. Default: ``False``.
  attn_bef : bool
      If ``True``, add another attention layer before propagation. Default: ``False``.
  dropout : float
      The dropout rate in mlp layers. Default: ``0.0``.
  attn_dropout : float
      The dropout rate of attention values. Default: ``0.0``.
  inp_dropout : float
      The dropout rate on input features. Default: ``0.0``.
  
  
  Note
  ----
   ``add_self_loop`` will be automatically called before propagation.
  
  Example
  -------
  >>> import dgl
  >>> from dgl.nn import TWIRLSConv
  >>> import torch as th
  
  >>> g = dgl.graph(([0,1,2,3,2,5], [1,2,3,4,0,3]))
  >>> feat = th.ones(6, 10)
  >>> conv = TWIRLSConv(10, 2, 128, prop_step = 64)
  >>> res = conv(g , feat)
  >>> res.size()
  torch.Size([6, 2])
class_docstr_tok: ["Convolution","together","with","iteratively","reweighting","least","squre","from","`","Graph","Neural","Networks","Inspired","by","Classical","Iterative","Algorithms","<","https",":","\/\/arxiv.org\/pdf\/2103.06064.pdf",">","`","__","Parameters","--","--","--","--","--","input_d",":","int","Number","of","input","features",".","output_d",":","int","Number","of","output","features",".","hidden_d",":","int","Size","of","hidden","layers",".","prop_step",":","int","Number","of","propagation","steps","num_mlp_before",":","int","Number","of","mlp","layers","before","propagation",".","Default",":","``","1","``",".","num_mlp_after",":","int","Number","of","mlp","layers","after","propagation",".","Default",":","``","1","``",".","norm",":","str","The","type","of","norm","layers","inside","mlp","layers",".","Can","be","``","'batch","'","``",",","``","'layer","'","``","or","``","'none","'","``",".","Default",":","``","'none","'","``","precond",":","str","If","True",",","use","pre","conditioning","and","unormalized","laplacian",",","else","not","use","pre","conditioning","and","use","normalized","laplacian",".","Default",":","``","True","``","alp",":","float","The",":","math",":","`","\\alpha","`","in","paper",".","If","equal","to",":","math",":","`","0","`",",","will","be","automatically","decided","based","on","other","hyper","prameters",".","Default",":","``","0","``",".","lam",":","float","The",":","math",":","`","\\lambda","`","in","paper",".","Default",":","``","1","``",".","attention",":","bool","If","``","True","``",",","add","an","attention","layer","inside","propagations",".","Default",":","``","False","``",".","tau",":","float","The",":","math",":","`","\\tau","`","in","paper",".","Default",":","``","0.2","``",".","T",":","float","The",":","math",":","`","T","`","in","paper",".","If","<","0",",",":","math",":","`","T","`","will","be","set","to","`","\\infty","`",".","Default",":","``","-1","``",".","p",":","float","The",":","math",":","`","p","`","in","paper",".","Default",":","``","1","``",".","use_eta",":","bool","If","``","True","``",",","add","a","learnable","weight","on","each","dimension","in","attention",".","Default",":","``","False","``",".","attn_bef",":","bool","If","``","True","``",",","add","another","attention","layer","before","propagation",".","Default",":","``","False","``",".","dropout",":","float","The","dropout","rate","in","mlp","layers",".","Default",":","``","0.0","``",".","attn_dropout",":","float","The","dropout","rate","of","attention","values",".","Default",":","``","0.0","``",".","inp_dropout",":","float","The","dropout","rate","on","input","features",".","Default",":","``","0.0","``",".","Note","--","--","``","add_self_loop","``","will","be","automatically","called","before","propagation",".","Example","--","--","--","-",">",">",">","import","dgl",">",">",">","from","dgl.nn","import","TWIRLSConv",">",">",">","import","torch","as","th",">",">",">","g","=","dgl.graph","(","(","[","0,1,2,3,2,5","]",",","[","1,2,3,4,0,3","]",")",")",">",">",">","feat","=","th.ones","(","6",",","10",")",">",">",">","conv","=","TWIRLSConv","(","10",",","2",",","128",",","prop_step","=","64",")",">",">",">","res","=","conv","(","g",",","feat",")",">",">",">","res.size","(",")","torch.Size","(","[","6",",","2","]",")"]
docstr: Description
  -----------
  Run TWIRLS forward.
  
  Parameters
  ----------
  graph : DGLGraph
      The graph.
  feat : torch.Tensor
      The initial node features.
  Returns
  -------
  torch.Tensor
      The output feature
  
  Note
  ----
  * Input shape: :math:`(N, \text{input_d})` where :math:`N` is the number of nodes.
  * Output shape: :math:`(N, \text{output_d})`.
docstr_tok: ["Description","--","--","--","--","--","-","Run","TWIRLS","forward",".","Parameters","--","--","--","--","--","graph",":","DGLGraph","The","graph",".","feat",":","torch.Tensor","The","initial","node","features",".","Returns","--","--","--","-","torch.Tensor","The","output","feature","Note","--","--","*","Input","shape",":",":","math",":","`","(","N",",","\\text","{","input_d","}",")","`","where",":","math",":","`","N","`","is","the","number","of","nodes",".","*","Output","shape",":",":","math",":","`","(","N",",","\\text","{","output_d","}",")","`","."]
code: def forward(self, graph, feat):
      r"""
  
      Description
      -----------
      Run TWIRLS forward.
  
      Parameters
      ----------
      graph : DGLGraph
          The graph.
      feat : torch.Tensor
          The initial node features.
      Returns
      -------
      torch.Tensor
          The output feature
  
      Note
      ----
      * Input shape: :math:`(N, \text{input_d})` where :math:`N` is the number of nodes.
      * Output shape: :math:`(N, \text{output_d})`.
      """
  
      # ensure self loop
      graph = graph.remove_self_loop()
      graph = graph.add_self_loop()
  
      x = feat
  
      if self.cacheable:
          # to cache unfolding result becase there is no paramaters before it
          if self.cached_unfolding is None:
              self.cached_unfolding = self.unfolding(graph, x)
  
          x = self.cached_unfolding
      else:
          if self.inp_dropout > 0:
              x = F.dropout(x, self.inp_dropout, training=self.training)
          x = self.mlp_bef(x)
          x = self.unfolding(graph, x)
  
      x = self.mlp_aft(x)
  
      return x
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from ....None import function
label_desc: Use image node_id 2 for calling the TWIRLSConv obj's underlying member method code with example usage: obj.forward(graph, feat) and returns: x