class_docstr: The graph upsampling augmentation from the
  `"Half-Hop: A Graph Upsampling Approach for Slowing Down Message Passing"
  <https://openreview.net/forum?id=lXczFIwQkv>`_ paper.
  The graph is augmented by adding artificial slow nodes between neighbors
  to slow down message propagation. (functional name: :obj:`half_hop`).
  
  .. note::
      :class:`HalfHop` augmentation is not supported if :obj:`data` has
      :attr:`edge_weight` or :attr:`edge_attr`.
  
  Args:
      alpha (float, optional): The interpolation factor
          used to compute slow node features
          :math:`x = \alpha*x_src + (1-\alpha)*x_dst` (default: :obj:`0.5`)
      p (float, optional): The probability of half-hopping
          an edge. (default: :obj:`1.0`)
  
  .. code-block:: python
  
      import torch_geometric.transforms as T
  
      transform = T.HalfHop(alpha=0.5)
      data = transform(data)  # Apply transformation.
      out = model(data.x, data.edge_index)  # Feed-forward.
      out = out[~data.slow_node_mask]  # Get rid of slow nodes.
code: def __init__(self, alpha: float = 0.5, p: float = 1.0) -> None:
      if alpha < 0.0 or alpha > 1.0:
          raise ValueError(
              f"Interpolation factor has to be between 0 and 1 "
              f"(got '{alpha}'"
          )
      if p < 0.0 or p > 1.0:
          raise ValueError(
              f"Ratio of half-hopped edges has to be between "
              f"0 and 1 (got '{p}'"
          )
  
      self.p = p
      self.alpha = alpha
  
file_path: pytorch_geometric/torch_geometric/transforms/half_hop.py
imports: import torch
  from torch_geometric.data import Data
  from torch_geometric.data.datapipes import functional_transform
  from torch_geometric.transforms import BaseTransform
label_desc: Use image node_id 1 to create a new HalfHop object from inherited base classes: BaseTransform with example: obj = HalfHop(alpha, p)