class_docstr: Resource Efficient Separation Pipeline Used for RE-SepFormer and SkiM
  
  Note: This implementation is a generalization of the ESPNET implementation of SkiM
  
  Arguments:
  ----------
  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: int
      Number of basic SkiM blocks
  segment_size: int
      Segmentation size for splitting long features
  bidirectional: bool,
      Whether the RNN layers are bidirectional.
  mem_type: 'hc', 'h', 'c', 'id' or None.
      This 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_model: class
      The model that processes the within segment elements
  mem_model: class
      The memory model that ensures continuity between the segments
  
  Example
  ---------
  >>> x = torch.randn(10, 100, 64)
  >>> seg_mdl = SBTransformerBlock_wnormandskip(1, 64, 8)
  >>> mem_mdl = SBTransformerBlock_wnormandskip(1, 64, 8)
  >>> resepf_pipeline = ResourceEfficientSeparationPipeline(64, 64, 128, seg_model=seg_mdl, mem_model=mem_mdl)
  >>> out = resepf_pipeline.forward(x)
  >>> out.shape
  torch.Size([10, 100, 128])
code: def __init__(
      self,
      input_size,
      hidden_size,
      output_size,
      dropout=0.0,
      num_blocks=2,
      segment_size=20,
      bidirectional=True,
      mem_type="av",
      norm_type="gln",
      seg_model=None,
      mem_model=None,
  ):
      super().__init__()
      self.input_size = input_size
      self.output_size = output_size
      self.hidden_size = hidden_size
      self.segment_size = segment_size
      self.dropout = dropout
      self.num_blocks = num_blocks
      self.mem_type = mem_type
      self.norm_type = norm_type
  
      assert mem_type in [
          "hc",
          "h",
          "c",
          "id",
          "av",
          None,
      ], f"only support 'hc', 'h', 'c', 'id', 'av' and None, current type: {mem_type}"
  
      self.seg_model = nn.ModuleList([])
      for i in range(num_blocks):
          self.seg_model.append(copy.deepcopy(seg_model))
  
      if self.mem_type is not None:
          self.mem_model = nn.ModuleList([])
          for i in range(num_blocks - 1):
              self.mem_model.append(copy.deepcopy(mem_model))
  
      self.output_fc = nn.Sequential(
          nn.PReLU(), nn.Conv1d(input_size, output_size, 1)
      )
  
imports: import torch
  import torch.nn
  from speechbrain.lobes.models.dual_path import select_norm
  from speechbrain.lobes.models.transformer.Transformer import TransformerEncoder, PositionalEncoding, get_lookahead_mask
  import speechbrain.nnet.RNN
  import copy
label_desc: Use image node_id 1 to create a new ResourceEfficientSeparationPipeline object from inherited base classes: nn with example: obj = ResourceEfficientSeparationPipeline(input_size, hidden_size, output_size, dropout, num_blocks, segment_size, bidirectional, mem_type, norm_type, seg_model, mem_model)