class_docstr: Description
  -----------
  Introduced in `Combining Label Propagation and Simple Models Out-performs Graph Neural Networks <https://arxiv.org/abs/2010.13993>`_
  
  Parameters
  ----------
      num_correction_layers: int
          The number of correct propagations.
      correction_alpha: float
          The coefficient of correction.
      correction_adj: str
          'DAD': D^-0.5 * A * D^-0.5
          'DA': D^-1 * A
          'AD': A * D^-1
      num_smoothing_layers: int
          The number of smooth propagations.
      smoothing_alpha: float
          The coefficient of smoothing.
      smoothing_adj: str
          'DAD': D^-0.5 * A * D^-0.5
          'DA': D^-1 * A
          'AD': A * D^-1
      autoscale: bool, optional
          If set to True, will automatically determine the scaling factor :math:`\sigma`. Default is True.
      scale: float, optional
          The scaling factor :math:`\sigma`, in case :obj:`autoscale = False`. Default is 1.
code: def correct(self, g, y_soft, y_true, mask):
      with g.local_scope():
          assert abs(float(y_soft.sum()) / y_soft.size(0) - 1.0) < 1e-2
          numel = (
              int(mask.sum())
              if mask.dtype == torch.bool
              else mask.size(0)
          )
          assert y_true.size(0) == numel
  
          if y_true.dtype == torch.long:
              y_true = F.one_hot(y_true.view(-1), y_soft.size(-1)).to(
                  y_soft.dtype
              )
  
          error = torch.zeros_like(y_soft)
          error[mask] = y_true - y_soft[mask]
  
          if self.autoscale:
              smoothed_error = self.prop1(
                  g, error, post_step=lambda x: x.clamp_(-1.0, 1.0)
              )
              sigma = error[mask].abs().sum() / numel
              scale = sigma / smoothed_error.abs().sum(
                  dim=1, keepdim=True
              )
              scale[scale.isinf() | (scale > 1000)] = 1.0
  
              result = y_soft + scale * smoothed_error
              result[result.isnan()] = y_soft[result.isnan()]
              return result
          else:
  
              def fix_input(x):
                  x[mask] = error[mask]
                  return x
  
              smoothed_error = self.prop1(g, error, post_step=fix_input)
  
              result = y_soft + self.scale * smoothed_error
              result[result.isnan()] = y_soft[result.isnan()]
              return result
  
imports: import dgl.function
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the CorrectAndSmooth obj's underlying member method code with example usage: obj.correct(g, y_soft, y_true, mask) and returns: result, result, x