class_docstr: Contexutal Block Encoder layer module.
  
  Args:
      size (int): Input dimension.
      self_attn (torch.nn.Module): Self-attention module instance.
          `MultiHeadedAttention` or `RelPositionMultiHeadedAttention` instance
          can be used as the argument.
      feed_forward (torch.nn.Module): Feed-forward module instance.
          `PositionwiseFeedForward`, `MultiLayeredConv1d`, or `Conv1dLinear` instance
          can be used as the argument.
      feed_forward_macaron (torch.nn.Module): Additional feed-forward module instance.
          `PositionwiseFeedForward`, `MultiLayeredConv1d`, or `Conv1dLinear` instance
          can be used as the argument.
      conv_module (torch.nn.Module): Convolution module instance.
          `ConvlutionModule` instance can be used as the argument.
      dropout_rate (float): Dropout rate.
      total_layer_num (int): Total number of layers
      normalize_before (bool): Whether to use layer_norm before the first block.
      concat_after (bool): Whether to concat attention layer's input and output.
          if True, additional linear will be applied.
          i.e. x -> x + linear(concat(x, att(x)))
          if False, no additional linear will be applied. i.e. x -> x + att(x)
docstr: Calculate forward propagation.
code: def forward(
      self,
      x,
      mask,
      infer_mode=False,
      past_ctx=None,
      next_ctx=None,
      is_short_segment=False,
      layer_idx=0,
      cache=None,
  ):
      """Calculate forward propagation."""
      if self.training or not infer_mode:
          return self.forward_train(
              x, mask, past_ctx, next_ctx, layer_idx, cache
          )
      else:
          return self.forward_infer(
              x,
              mask,
              past_ctx,
              next_ctx,
              is_short_segment,
              layer_idx,
              cache,
          )
  
file_path: espnet/espnet/nets/pytorch_backend/conformer/contextual_block_encoder_layer.py
imports: import torch
  from torch import nn
  from espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm
label_desc: Use image node_id 2 for calling the ContextualBlockEncoderLayer obj's underlying member method code with example usage: obj.forward(x, mask, infer_mode, past_ctx, next_ctx, is_short_segment, layer_idx, cache) and returns: self, self