docstr: Forward.
  
  Args:
      input (torch.Tensor): feature sequence (batch, C, N, freq, time)
      ref_channel (None or int): index of the reference channel.
          if None, simply average all channels.
          if int, take the specified channel instead of averaging.
  Returns:
      output (torch.Tensor): output sequence (batch, C, N, freq, time)
docstr_tok: ["Forward",".","Args",":","input","(","torch.Tensor",")",":","feature","sequence","(","batch",",","C",",","N",",","freq",",","time",")","ref_channel","(","None","or","int",")",":","index","of","the","reference","channel",".","if","None",",","simply","average","all","channels",".","if","int",",","take","the","specified","channel","instead","of","averaging",".","Returns",":","output","(","torch.Tensor",")",":","output","sequence","(","batch",",","C",",","N",",","freq",",","time",")"]
code: def forward(self, input, ref_channel=None):
      """Forward.
  
      Args:
          input (torch.Tensor): feature sequence (batch, C, N, freq, time)
          ref_channel (None or int): index of the reference channel.
              if None, simply average all channels.
              if int, take the specified channel instead of averaging.
      Returns:
          output (torch.Tensor): output sequence (batch, C, N, freq, time)
      """
      if not self.with_channel_modeling:
          if input.size(1) > 1 and ref_channel is not None:
              input = input[:, ref_channel].unsqueeze(1)
          else:
              input = input.mean(dim=1, keepdim=True)
      B, C, N, F, T = input.shape
      output = input.reshape(B * C, N, F, T).contiguous()
      output = self.freq_path_process(output)
      output = self.time_path_process(output)
      output = output.contiguous().reshape(B, C, N, F, T)
      if self.with_channel_modeling:
          output = self.channel_nn(output, ref_channel=ref_channel)
      return output
  
imports: import warnings
  import torch
  import torch.nn
  from espnet2.enh.layers.dptnet import ImprovedTransformerLayer
  from espnet2.enh.layers.tcn import ChannelwiseLayerNorm
  from espnet2.torch_utils.get_layer_from_string import get_layer
label_desc: Use image node_id 2 for calling the ATFBlock obj's underlying member method code with example usage: obj.forward(input, ref_channel) and returns: output