class_docstr: Skipping Memory Net
  
  args:
      input_size: int, dimension of the input feature.
          Input shape shoud be (batch, length, input_size)
      hidden_size: int, dimension of the hidden state.
      output_size: int, dimension of the output size.
      dropout: float, dropout ratio. Default is 0.
      num_blocks: number of basic SkiM blocks
      segment_size: segmentation size for splitting long features
      bidirectional: bool, whether the RNN layers are bidirectional.
      mem_type: 'hc', 'h', 'c', 'id' or None.
          It controls whether the hidden (or cell) state of SegLSTM
          will be processed by MemLSTM.
          In 'id' mode, both the hidden and cell states will
          be identically returned.
          When mem_type is None, the MemLSTM will be removed.
      norm_type: gLN, cLN. cLN is for causal implementation.
      seg_overlap: Bool, whether the segmentation will reserve 50%
          overlap for adjacent segments.Default is False.
class_docstr_tok: ["Skipping","Memory","Net","args",":","input_size",":","int",",","dimension","of","the","input","feature",".","Input","shape","shoud","be","(","batch",",","length",",","input_size",")","hidden_size",":","int",",","dimension","of","the","hidden","state",".","output_size",":","int",",","dimension","of","the","output","size",".","dropout",":","float",",","dropout","ratio",".","Default","is","0.","num_blocks",":","number","of","basic","SkiM","blocks","segment_size",":","segmentation","size","for","splitting","long","features","bidirectional",":","bool",",","whether","the","RNN","layers","are","bidirectional",".","mem_type",":","'hc","'",",","'","h","'",",","'","c","'",",","'id","'","or","None",".","It","controls","whether","the","hidden","(","or","cell",")","state","of","SegLSTM","will","be","processed","by","MemLSTM",".","In","'id","'","mode",",","both","the","hidden","and","cell","states","will","be","identically","returned",".","When","mem_type","is","None",",","the","MemLSTM","will","be","removed",".","norm_type",":","gLN",",","cLN",".","cLN","is","for","causal","implementation",".","seg_overlap",":","Bool",",","whether","the","segmentation","will","reserve","50","%","overlap","for","adjacent","segments.Default","is","False","."]
code: def forward(self, input):
      # input shape: B, T (S*K), D
      B, T, D = input.shape
  
      if self.seg_overlap:
          input, rest = split_feature(
              input.transpose(1, 2), segment_size=self.segment_size
          )  # B, D, K, S
          input = input.permute(0, 3, 2, 1).contiguous()  # B, S, K, D
      else:
          input, rest = self._padfeature(input=input)
          input = input.view(B, -1, self.segment_size, D)  # B, S, K, D
      B, S, K, D = input.shape
  
      assert K == self.segment_size
  
      output = input.view(B * S, K, D).contiguous()  # BS, K, D
      hc = None
      for i in range(self.num_blocks):
          output, hc = self.seg_lstms[i](output, hc)  # BS, K, D
          if self.mem_type and i < self.num_blocks - 1:
              hc = self.mem_lstms[i](hc, S)
              pass
  
      if self.seg_overlap:
          output = output.view(B, S, K, D).permute(
              0, 3, 2, 1
          )  # B, D, K, S
          output = merge_feature(output, rest)  # B, D, T
          output = self.output_fc(output).transpose(1, 2)
  
      else:
          output = output.view(B, S * K, D)[:, :T, :]  # B, T, D
          output = self.output_fc(output.transpose(1, 2)).transpose(
              1, 2
          )
  
      return output
  
file_path: espnet/espnet2/enh/layers/skim.py
imports: import torch
  import torch.nn
  from espnet2.enh.layers.dprnn import SingleRNN, merge_feature, split_feature
  from espnet2.enh.layers.tcn import choose_norm
label_desc: Use image node_id 2 for calling the SkiM obj's underlying member method code with example usage: obj.forward(input) and returns: output