class_docstr: DiffPool Fuse
class_docstr_tok: ["DiffPool","Fuse"]
docstr: Return gc_layer embedding cat.
docstr_tok: ["Return","gc_layer","embedding","cat","."]
code: def gcn_forward(self, g, h, gc_layers, cat=False):
      """
      Return gc_layer embedding cat.
      """
      block_readout = []
      for gc_layer in gc_layers[:-1]:
          h = gc_layer(g, h)
          block_readout.append(h)
      h = gc_layers[-1](g, h)
      block_readout.append(h)
      if cat:
          block = torch.cat(
              block_readout, dim=1
          )  # N x F, F = F1 + F2 + ...
      else:
          block = h
      return block
  
file_path: dgl/examples/pytorch/diffpool/model/encoder.py
imports: import time
  import dgl
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from scipy.linalg import block_diag
  from torch.nn import init
  from .dgl_layers import DiffPoolBatchedGraphLayer, GraphSage, GraphSageLayer
  from .model_utils import batch2tensor
  from .tensorized_layers import *
label_desc: Use image node_id 2 for calling the DiffPool obj's underlying member method code with example usage: obj.gcn_forward(g, h, gc_layers, cat) and returns: block