class_docstr: Multi-scale Diarization Decoder (MSDD) for overlap-aware diarization and improved diarization accuracy from clustering diarizer.
  Based on the paper: Taejin Park et. al, "Multi-scale Speaker Diarization with Dynamic Scale Weighting", Interspeech 2022.
  Arxiv version: https://arxiv.org/pdf/2203.15974.pdf
  
  Args:
      num_spks (int):
          Max number of speakers that are processed by the model. In `MSDD_module`, `num_spks=2` for pairwise inference.
      hidden_size (int):
          Number of hidden units in sequence models and intermediate layers.
      num_lstm_layers (int):
          Number of the stacked LSTM layers.
      dropout_rate (float):
          Dropout rate for linear layers, CNN and LSTM.
      cnn_output_ch (int):
          Number of channels per each CNN layer.
      emb_dim (int):
          Dimension of the embedding vectors.
      scale_n (int):
          Number of scales in multi-scale system.
      clamp_max (float):
          Maximum value for limiting the scale weight values.
      conv_repeat (int):
          Number of CNN layers after the first CNN layer.
      weighting_scheme (str):
          Name of the methods for estimating the scale weights.
      context_vector_type (str):
          If 'cos_sim', cosine similarity values are used for the input of the sequence models.
          If 'elem_prod', element-wise product values are used for the input of the sequence models.
class_docstr_tok: ["Multi-scale","Diarization","Decoder","(","MSDD",")","for","overlap-aware","diarization","and","improved","diarization","accuracy","from","clustering","diarizer",".","Based","on","the","paper",":","Taejin","Park","et",".","al",",","``","Multi-scale","Speaker","Diarization","with","Dynamic","Scale","Weighting","''",",","Interspeech","2022",".","Arxiv","version",":","https",":","\/\/arxiv.org\/pdf\/2203.15974.pdf","Args",":","num_spks","(","int",")",":","Max","number","of","speakers","that","are","processed","by","the","model",".","In","`","MSDD_module","`",",","`","num_spks=2","`","for","pairwise","inference",".","hidden_size","(","int",")",":","Number","of","hidden","units","in","sequence","models","and","intermediate","layers",".","num_lstm_layers","(","int",")",":","Number","of","the","stacked","LSTM","layers",".","dropout_rate","(","float",")",":","Dropout","rate","for","linear","layers",",","CNN","and","LSTM",".","cnn_output_ch","(","int",")",":","Number","of","channels","per","each","CNN","layer",".","emb_dim","(","int",")",":","Dimension","of","the","embedding","vectors",".","scale_n","(","int",")",":","Number","of","scales","in","multi-scale","system",".","clamp_max","(","float",")",":","Maximum","value","for","limiting","the","scale","weight","values",".","conv_repeat","(","int",")",":","Number","of","CNN","layers","after","the","first","CNN","layer",".","weighting_scheme","(","str",")",":","Name","of","the","methods","for","estimating","the","scale","weights",".","context_vector_type","(","str",")",":","If","'cos_sim","'",",","cosine","similarity","values","are","used","for","the","input","of","the","sequence","models",".","If","'elem_prod","'",",","element-wise","product","values","are","used","for","the","input","of","the","sequence","models","."]
docstr: A module for convolutional neural networks with 1-D filters. As a unit layer batch normalization, non-linear layer and dropout
  modules are included.
  
  Note:
      If `first_layer=True`, the input shape is set for processing embedding input.
      If `first_layer=False`, then the input shape is set for processing the output from another `conv_forward` module.
  
  Args:
      conv_input (Tensor):
          Reshaped tensor containing cluster-average embeddings and multi-scale embedding sequences.
          Shape: (batch_size*length, 1, scale_n*(num_spks+1), emb_dim)
      conv_module (ConvLayer):
          ConvLayer instance containing torch.nn.modules.conv modules.
      bn_module (torch.nn.modules.batchnorm.BatchNorm2d):
          Predefined Batchnorm module.
      first_layer (bool):
          Boolean for switching between the first layer and the others.
          Default: `False`
  
  Returns:
      conv_out (Tensor):
          Convnet output that can be fed to another ConvLayer module or linear layer.
          Shape: (batch_size*length, 1, cnn_output_ch, emb_dim)
docstr_tok: ["A","module","for","convolutional","neural","networks","with","1-D","filters",".","As","a","unit","layer","batch","normalization",",","non-linear","layer","and","dropout","modules","are","included",".","Note",":","If","`","first_layer=True","`",",","the","input","shape","is","set","for","processing","embedding","input",".","If","`","first_layer=False","`",",","then","the","input","shape","is","set","for","processing","the","output","from","another","`","conv_forward","`","module",".","Args",":","conv_input","(","Tensor",")",":","Reshaped","tensor","containing","cluster-average","embeddings","and","multi-scale","embedding","sequences",".","Shape",":","(","batch_size","*","length",",","1",",","scale_n","*","(","num_spks+1",")",",","emb_dim",")","conv_module","(","ConvLayer",")",":","ConvLayer","instance","containing","torch.nn.modules.conv","modules",".","bn_module","(","torch.nn.modules.batchnorm.BatchNorm2d",")",":","Predefined","Batchnorm","module",".","first_layer","(","bool",")",":","Boolean","for","switching","between","the","first","layer","and","the","others",".","Default",":","`","False","`","Returns",":","conv_out","(","Tensor",")",":","Convnet","output","that","can","be","fed","to","another","ConvLayer","module","or","linear","layer",".","Shape",":","(","batch_size","*","length",",","1",",","cnn_output_ch",",","emb_dim",")"]
code: def conv_forward(
      self, conv_input, conv_module, bn_module, first_layer=False
  ):
      """
      A module for convolutional neural networks with 1-D filters. As a unit layer batch normalization, non-linear layer and dropout
      modules are included.
  
      Note:
          If `first_layer=True`, the input shape is set for processing embedding input.
          If `first_layer=False`, then the input shape is set for processing the output from another `conv_forward` module.
  
      Args:
          conv_input (Tensor):
              Reshaped tensor containing cluster-average embeddings and multi-scale embedding sequences.
              Shape: (batch_size*length, 1, scale_n*(num_spks+1), emb_dim)
          conv_module (ConvLayer):
              ConvLayer instance containing torch.nn.modules.conv modules.
          bn_module (torch.nn.modules.batchnorm.BatchNorm2d):
              Predefined Batchnorm module.
          first_layer (bool):
              Boolean for switching between the first layer and the others.
              Default: `False`
  
      Returns:
          conv_out (Tensor):
              Convnet output that can be fed to another ConvLayer module or linear layer.
              Shape: (batch_size*length, 1, cnn_output_ch, emb_dim)
      """
      conv_out = conv_module(conv_input)
      conv_out = (
          conv_out.permute(0, 2, 1, 3) if not first_layer else conv_out
      )
      conv_out = conv_out.reshape(
          self.batch_size, self.length, self.cnn_output_ch, self.emb_dim
      )
      conv_out = conv_out.unsqueeze(2).flatten(0, 1)
      conv_out = bn_module(conv_out.permute(0, 3, 2, 1)).permute(
          0, 3, 2, 1
      )
      conv_out = self.dropout(F.leaky_relu(conv_out))
      return conv_out
  
imports: from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.exportable import Exportable
  from nemo.core.classes.module import NeuralModule
  from nemo.core.neural_types import EncodedRepresentation, LengthsType, NeuralType, SpectrogramType
  from nemo.core.neural_types.elements import ProbsType
label_desc: Use image node_id 10 for calling the MSDD_module obj's underlying member method code with example usage: obj.conv_forward(conv_input, conv_module, bn_module, first_layer) and returns: conv_out