class_docstr: The Graph U-Net model from the `"Graph U-Nets"
  <https://arxiv.org/abs/1905.05178>`_ paper which implements a U-Net like
  architecture with graph pooling and unpooling operations.
  
  Args:
      in_channels (int): Size of each input sample.
      hidden_channels (int): Size of each hidden sample.
      out_channels (int): Size of each output sample.
      depth (int): The depth of the U-Net architecture.
      pool_ratios (float or [float], optional): Graph pooling ratio for each
          depth. (default: :obj:`0.5`)
      sum_res (bool, optional): If set to :obj:`False`, will use
          concatenation for integration of skip connections instead
          summation. (default: :obj:`True`)
      act (torch.nn.functional, optional): The nonlinearity to use.
          (default: :obj:`torch.nn.functional.relu`)
class_docstr_tok: ["The","Graph","U-Net","model","from","the","`","``","Graph","U-Nets","''","<","https",":","\/\/arxiv.org\/abs\/1905.05178",">","`","_","paper","which","implements","a","U-Net","like","architecture","with","graph","pooling","and","unpooling","operations",".","Args",":","in_channels","(","int",")",":","Size","of","each","input","sample",".","hidden_channels","(","int",")",":","Size","of","each","hidden","sample",".","out_channels","(","int",")",":","Size","of","each","output","sample",".","depth","(","int",")",":","The","depth","of","the","U-Net","architecture",".","pool_ratios","(","float","or","[","float","]",",","optional",")",":","Graph","pooling","ratio","for","each","depth",".","(","default",":",":","obj",":","`","0.5","`",")","sum_res","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","will","use","concatenation","for","integration","of","skip","connections","instead","summation",".","(","default",":",":","obj",":","`","True","`",")","act","(","torch.nn.functional",",","optional",")",":","The","nonlinearity","to","use",".","(","default",":",":","obj",":","`","torch.nn.functional.relu","`",")"]
code: def forward(
      self, x: Tensor, edge_index: Tensor, batch: OptTensor = None
  ) -> Tensor:
      """"""  # noqa: D419
      if batch is None:
          batch = edge_index.new_zeros(x.size(0))
      edge_weight = x.new_ones(edge_index.size(1))
  
      x = self.down_convs[0](x, edge_index, edge_weight)
      x = self.act(x)
  
      xs = [x]
      edge_indices = [edge_index]
      edge_weights = [edge_weight]
      perms = []
  
      for i in range(1, self.depth + 1):
          edge_index, edge_weight = self.augment_adj(
              edge_index, edge_weight, x.size(0)
          )
          x, edge_index, edge_weight, batch, perm, _ = self.pools[
              i - 1
          ](x, edge_index, edge_weight, batch)
  
          x = self.down_convs[i](x, edge_index, edge_weight)
          x = self.act(x)
  
          if i < self.depth:
              xs += [x]
              edge_indices += [edge_index]
              edge_weights += [edge_weight]
          perms += [perm]
  
      for i in range(self.depth):
          j = self.depth - 1 - i
  
          res = xs[j]
          edge_index = edge_indices[j]
          edge_weight = edge_weights[j]
          perm = perms[j]
  
          up = torch.zeros_like(res)
          up[perm] = x
          x = res + up if self.sum_res else torch.cat((res, up), dim=-1)
  
          x = self.up_convs[i](x, edge_index, edge_weight)
          x = self.act(x) if i < self.depth - 1 else x
  
      return x
  
file_path: pytorch_geometric/torch_geometric/nn/models/graph_unet.py
imports: from typing import Callable, List, Union
  import torch
  from torch import Tensor
  from torch_geometric.nn import GCNConv, TopKPooling
  from torch_geometric.nn.resolver import activation_resolver
  from torch_geometric.typing import OptTensor, PairTensor
  from torch_geometric.utils import add_self_loops, remove_self_loops, to_torch_csr_tensor
  from torch_geometric.utils.repeat import repeat
label_desc: Use image node_id 3 for calling the GraphUNet obj's underlying member method code with example usage: obj.forward(x, edge_index, batch) and returns: x