docstr: Container module for a single Attentive Time-Frequency Block.
  
  Args:
      input_size (int): dimension of the input feature.
      rnn_type (str): type of the RNN cell in the improved Transformer layer.
      hidden_size (int): hidden dimension of the RNN cell.
      att_heads (int): number of attention heads in Transformer.
      dropout (float): dropout ratio. Default is 0.
      activation (str): non-linear activation function applied in each block.
      bidirectional (bool): whether the RNN layers are bidirectional.
      norm_type (str): normalization type in the improved Transformer layer.
      ch_mode (str): mode of channel modeling. Select from "att" and "tac".
      ch_att_dim (int): dimension of the channel attention.
      eps (float): epsilon for layer normalization.
      with_channel_modeling (bool): whether to use channel modeling.
docstr_tok: ["Container","module","for","a","single","Attentive","Time-Frequency","Block",".","Args",":","input_size","(","int",")",":","dimension","of","the","input","feature",".","rnn_type","(","str",")",":","type","of","the","RNN","cell","in","the","improved","Transformer","layer",".","hidden_size","(","int",")",":","hidden","dimension","of","the","RNN","cell",".","att_heads","(","int",")",":","number","of","attention","heads","in","Transformer",".","dropout","(","float",")",":","dropout","ratio",".","Default","is","0.","activation","(","str",")",":","non-linear","activation","function","applied","in","each","block",".","bidirectional","(","bool",")",":","whether","the","RNN","layers","are","bidirectional",".","norm_type","(","str",")",":","normalization","type","in","the","improved","Transformer","layer",".","ch_mode","(","str",")",":","mode","of","channel","modeling",".","Select","from","``","att","''","and","``","tac","''",".","ch_att_dim","(","int",")",":","dimension","of","the","channel","attention",".","eps","(","float",")",":","epsilon","for","layer","normalization",".","with_channel_modeling","(","bool",")",":","whether","to","use","channel","modeling","."]
code: def __init__(
      self,
      input_size,
      rnn_type="lstm",
      hidden_size=128,
      att_heads=4,
      dropout=0.0,
      activation="relu",
      bidirectional=True,
      norm_type="cLN",
      ch_mode="att",
      ch_att_dim=256,
      eps=1e-5,
      with_channel_modeling=True,
  ):
      """Container module for a single Attentive Time-Frequency Block.
  
      Args:
          input_size (int): dimension of the input feature.
          rnn_type (str): type of the RNN cell in the improved Transformer layer.
          hidden_size (int): hidden dimension of the RNN cell.
          att_heads (int): number of attention heads in Transformer.
          dropout (float): dropout ratio. Default is 0.
          activation (str): non-linear activation function applied in each block.
          bidirectional (bool): whether the RNN layers are bidirectional.
          norm_type (str): normalization type in the improved Transformer layer.
          ch_mode (str): mode of channel modeling. Select from "att" and "tac".
          ch_att_dim (int): dimension of the channel attention.
          eps (float): epsilon for layer normalization.
          with_channel_modeling (bool): whether to use channel modeling.
      """
      super().__init__()
  
      kwargs = dict(
          rnn_type=rnn_type,
          input_size=input_size,
          att_heads=att_heads,
          hidden_size=hidden_size,
          dropout=dropout,
          activation="linear",
          bidirectional=bidirectional,
          norm=norm_type,
      )
      self.freq_nn = SingleTransformer(**kwargs)
      self.temporal_nn = SingleTransformer(**kwargs)
  
      self.with_channel_modeling = with_channel_modeling
      self.ch_mode = ch_mode
      if with_channel_modeling:
          if ch_mode == "att":
              self.channel_nn = ChannelAttention(
                  input_dim=input_size,
                  att_heads=att_heads,
                  att_dim=ch_att_dim,
                  activation=activation,
                  eps=eps,
              )
          elif ch_mode == "tac":
              self.channel_nn = ChannelTAC(
                  input_dim=input_size, eps=eps
              )
          else:
              raise NotImplementedError(ch_mode)
  
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 1 to create a new ATFBlock object from inherited base classes: nn with example: obj = ATFBlock(input_size, rnn_type, hidden_size, att_heads, dropout, activation, bidirectional, norm_type, ch_mode, ch_att_dim, eps, with_channel_modeling)