class_docstr: Offline TFGridNet
  
  Reference:
  [1] Z.-Q. Wang, S. Cornell, S. Choi, Y. Lee, B.-Y. Kim, and S. Watanabe,
  "TF-GridNet: Integrating Full- and Sub-Band Modeling for Speech Separation",
  in arXiv preprint arXiv:2211.12433, 2022.
  [2] Z.-Q. Wang, S. Cornell, S. Choi, Y. Lee, B.-Y. Kim, and S. Watanabe,
  "TF-GridNet: Making Time-Frequency Domain Models Great Again for Monaural
  Speaker Separation", in arXiv preprint arXiv:2209.03952, 2022.
  
  NOTES:
  As outlined in the Reference, this model works best when trained with variance
  normalized mixture input and target, e.g., with mixture of shape [batch, samples,
  microphones], you normalize it by dividing with torch.std(mixture, (1, 2)). You
  must do the same for the target signals. It is encouraged to do so when not using
  scale-invariant loss functions such as SI-SDR.
  
  Args:
      input_dim: placeholder, not used
      n_srcs: number of output sources/speakers.
      n_fft: stft window size.
      stride: stft stride.
      window: stft window type choose between 'hamming', 'hanning' or None.
      n_imics: number of microphones channels (only fixed-array geometry supported).
      n_layers: number of TFGridNet blocks.
      lstm_hidden_units: number of hidden units in LSTM.
      attn_n_head: number of heads in self-attention
      attn_approx_qk_dim: approximate dimention of frame-level key and value tensors
      emb_dim: embedding dimension
      emb_ks: kernel size for unfolding and deconv1D
      emb_hs: hop size for unfolding and deconv1D
      activation: activation function to use in the whole TFGridNet model,
          you can use any torch supported activation e.g. 'relu' or 'elu'.
      eps: small epsilon for normalization layers.
      use_builtin_complex: whether to use builtin complex type or not.
code: def __init__(
      self,
      input_dim,
      n_srcs=2,
      n_fft=128,
      stride=64,
      window="hann",
      n_imics=1,
      n_layers=6,
      lstm_hidden_units=192,
      attn_n_head=4,
      attn_approx_qk_dim=512,
      emb_dim=48,
      emb_ks=4,
      emb_hs=1,
      activation="prelu",
      eps=1.0e-5,
      use_builtin_complex=False,
      ref_channel=-1,
  ):
      super().__init__()
      self.n_srcs = n_srcs
      self.n_layers = n_layers
      self.n_imics = n_imics
      assert n_fft % 2 == 0
      n_freqs = n_fft // 2 + 1
      self.ref_channel = ref_channel
  
      self.enc = STFTEncoder(
          n_fft,
          n_fft,
          stride,
          window=window,
          use_builtin_complex=use_builtin_complex,
      )
      self.dec = STFTDecoder(n_fft, n_fft, stride, window=window)
  
      t_ksize = 3
      ks, padding = (t_ksize, 3), (t_ksize // 2, 1)
      self.conv = nn.Sequential(
          nn.Conv2d(2 * n_imics, emb_dim, ks, padding=padding),
          nn.GroupNorm(1, emb_dim, eps=eps),
      )
  
      self.blocks = nn.ModuleList([])
      for _ in range(n_layers):
          self.blocks.append(
              GridNetBlock(
                  emb_dim,
                  emb_ks,
                  emb_hs,
                  n_freqs,
                  lstm_hidden_units,
                  n_head=attn_n_head,
                  approx_qk_dim=attn_approx_qk_dim,
                  activation=activation,
                  eps=eps,
              )
          )
  
      self.deconv = nn.ConvTranspose2d(
          emb_dim, n_srcs * 2, ks, padding=padding
      )
  
imports: import math
  from collections import OrderedDict
  from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn import init
  from torch.nn.parameter import Parameter
  from espnet2.enh.decoder.stft_decoder import STFTDecoder
  from espnet2.enh.encoder.stft_encoder import STFTEncoder
  from espnet2.enh.layers.complex_utils import new_complex_like
  from espnet2.enh.separator.abs_separator import AbsSeparator
  from espnet2.torch_utils.get_layer_from_string import get_layer
label_desc: Use image node_id 1 to create a new TFGridNet object from inherited base classes: AbsSeparator with example: obj = TFGridNet(input_dim, n_srcs, n_fft, stride, window, n_imics, n_layers, lstm_hidden_units, attn_n_head, attn_approx_qk_dim, emb_dim, emb_ks, emb_hs, activation, eps, use_builtin_complex, ref_channel)