docstr: create estimated mask for each speaker
  
  Args:
      mask_tensor (torch.Tensor): output of decoder, shape(B, 2*num_spk, F-1, T)
docstr_tok: ["create","estimated","mask","for","each","speaker","Args",":","mask_tensor","(","torch.Tensor",")",":","output","of","decoder",",","shape","(","B",",","2","*","num_spk",",","F-1",",","T",")"]
code: def create_masks(self, mask_tensor: torch.Tensor):
      """create estimated mask for each speaker
  
      Args:
          mask_tensor (torch.Tensor): output of decoder, shape(B, 2*num_spk, F-1, T)
      """
      if self.use_noise_mask:
          assert mask_tensor.shape[1] == 2 * (
              self._num_spk + 1
          ), mask_tensor.shape[1]
      else:
          assert (
              mask_tensor.shape[1] == 2 * self._num_spk
          ), mask_tensor.shape[1]
  
      masks = []
      for idx in range(mask_tensor.shape[1] // 2):
          # shape (B, F-1, T)
          mask_real = mask_tensor[:, idx * 2]
          # shape (B, F-1, T)
          mask_imag = mask_tensor[:, idx * 2 + 1]
          # shape (B, F, T)
          mask_real = F.pad(mask_real, [0, 0, 1, 0])
          # shape (B, F, T)
          mask_imag = F.pad(mask_imag, [0, 0, 1, 0])
  
          # mask shape (B, T, F)
          if is_torch_1_9_plus and self.use_builtin_complex:
              complex_mask = torch.complex(
                  mask_real.permute(0, 2, 1), mask_imag.permute(0, 2, 1)
              )
          else:
              complex_mask = ComplexTensor(
                  mask_real.permute(0, 2, 1), mask_imag.permute(0, 2, 1)
              )
  
          masks.append(complex_mask)
  
      return masks
  
file_path: espnet/espnet2/enh/separator/dccrn_separator.py
imports: from collections import OrderedDict
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.layers.complexnn import ComplexBatchNorm, ComplexConv2d, ComplexConvTranspose2d, NavieComplexLSTM, complex_cat
  from espnet2.enh.separator.abs_separator import AbsSeparator
label_desc: Use image node_id 4 for calling the DCCRNSeparator obj's underlying member method code with example usage: obj.create_masks(mask_tensor) and returns: masks