class_docstr: Constructs a single "Jasper" block. With modified parameters, also constructs other blocks for models
  such as `QuartzNet` and `Citrinet`.
  
  - For `Jasper`    : `separable` flag should be False
  - For `QuartzNet` : `separable` flag should be True
  - For `Citrinet`  : `separable` flag and `se` flag should be True
  
  Note that above are general distinctions, each model has intricate differences that expand over
  multiple such blocks.
  
  For further information about the differences between models which use JasperBlock, please review
  the configs for ASR models found in the ASR examples directory.
  
  Args:
      inplanes: Number of input channels.
      planes: Number of output channels.
      repeat: Number of repeated sub-blocks (R) for this block.
      kernel_size: Convolution kernel size across all repeated sub-blocks.
      kernel_size_factor: Floating point scale value that is multiplied with kernel size,
          then rounded down to nearest odd integer to compose the kernel size. Defaults to 1.0.
      stride: Stride of the convolutional layers.
      dilation: Integer which defined dilation factor of kernel. Note that when dilation > 1, stride must
          be equal to 1.
      padding: String representing type of padding. Currently only supports "same" padding,
          which symmetrically pads the input tensor with zeros.
      dropout: Floating point value, determins percentage of output that is zeroed out.
      activation: String representing activation functions. Valid activation functions are :
          {"hardtanh": nn.Hardtanh, "relu": nn.ReLU, "selu": nn.SELU, "swish": Swish}.
          Defaults to "relu".
      residual: Bool that determined whether a residual branch should be added or not.
          All residual branches are constructed using a pointwise convolution kernel, that may or may not
          perform strided convolution depending on the parameter `residual_mode`.
      groups: Number of groups for Grouped Convolutions. Defaults to 1.
      separable: Bool flag that describes whether Time-Channel depthwise separable convolution should be
          constructed, or ordinary convolution should be constructed.
      heads: Number of "heads" for the masked convolution. Defaults to -1, which disables it.
      normalization: String that represents type of normalization performed. Can be one of
          "batch", "group", "instance" or "layer" to compute BatchNorm1D, GroupNorm1D, InstanceNorm or
          LayerNorm (which are special cases of GroupNorm1D).
      norm_groups: Number of groups used for GroupNorm (if `normalization` == "group").
      residual_mode: String argument which describes whether the residual branch should be simply
          added ("add") or should first stride, then add ("stride_add"). Required when performing stride on
          parallel branch as well as utilizing residual add.
      residual_panes: Number of residual panes, used for Jasper-DR models. Please refer to the paper.
      conv_mask: Bool flag which determines whether to utilize masked convolutions or not. In general,
          it should be set to True.
      se: Bool flag that determines whether Squeeze-and-Excitation layer should be used.
      se_reduction_ratio: Integer value, which determines to what extend the hidden dimension of the SE
          intermediate step should be reduced. Larger values reduce number of parameters, but also limit
          the effectiveness of SE layers.
      se_context_window: Integer value determining the number of timesteps that should be utilized in order
          to compute the averaged context window. Defaults to -1, which means it uses global context - such
          that all timesteps are averaged. If any positive integer is used, it will utilize limited context
          window of that size.
      se_interpolation_mode: String used for interpolation mode of timestep dimension for SE blocks.
          Used only if context window is > 1.
          The modes available for resizing are: `nearest`, `linear` (3D-only),
          `bilinear`, `area`.
      stride_last: Bool flag that determines whether all repeated blocks should stride at once,
          (stride of S^R when this flag is False) or just the last repeated block should stride
          (stride of S when this flag is True).
      future_context: Int value that determins how many "right" / "future" context frames will be utilized
          when calculating the output of the conv kernel. All calculations are done for odd kernel sizes only.
  
          By default, this is -1, which is recomputed as the symmetric padding case.
  
          When future_context >= 0, will compute the asymmetric padding as follows :
          (left context, right context) = [K - 1 - future_context, future_context]
  
          Determining an exact formula to limit future context is dependent on global layout of the model.
          As such, we provide both "local" and "global" guidelines below.
  
          Local context limit (should always be enforced)
          - future context should be <= half the kernel size for any given layer
          - future context > kernel size defaults to symmetric kernel
          - future context of layer = number of future frames * width of each frame (dependent on stride)
  
          Global context limit (should be carefully considered)
          - future context should be layed out in an ever reducing pattern. Initial layers should restrict
          future context less than later layers, since shallow depth (and reduced stride) means each frame uses
          less amounts of future context.
          - Beyond a certain point, future context should remain static for a given stride level. This is
          the upper bound of the amount of future context that can be provided to the model on a global scale.
          - future context is calculated (roughly) as - (2 ^ stride) * (K // 2) number of future frames.
          This resultant value should be bound to some global maximum number of future seconds of audio (in ms).
  
          Note: In the special case where K < future_context, it is assumed that the kernel is too small to limit
          its future context, so symmetric padding is used instead.
  
          Note: There is no explicit limitation on the amount of future context used, as long as
          K > future_context constraint is maintained. This might lead to cases where future_context is
          more than half the actual kernel size K! In such cases, the conv layer is utilizing more of the future
          context than its current and past context to compute the output. While this is possible to do,
          it is not recommended and the layer will raise a warning to notify the user of such cases.
          It is advised to simply use symmetric padding for such cases.
  
          Example:
          Say we have a model that performs 8x stride and receives spectrogram frames with stride of 0.01s.
          Say we wish to upper bound future context to 80 ms.
  
          Layer ID, Kernel Size, Stride, Future Context, Global Context
          0, K=5,  S=1, FC=8, GC= 2 * (2^0) = 2 * 0.01 ms  (special case, K < FC so use symmetric pad)
          1, K=7,  S=1, FC=3, GC= 3 * (2^0) = 3 * 0.01 ms  (note that symmetric pad here uses 3 FC frames!)
          2, K=11, S=2, FC=4, GC= 4 * (2^1) = 8 * 0.01 ms  (note that symmetric pad here uses 5 FC frames!)
          3, K=15, S=1, FC=4, GC= 4 * (2^1) = 8 * 0.01 ms  (note that symmetric pad here uses 7 FC frames!)
          4, K=21, S=2, FC=2, GC= 2 * (2^2) = 8 * 0.01 ms  (note that symmetric pad here uses 10 FC frames!)
          5, K=25, S=2, FC=1, GC= 1 * (2^3) = 8 * 0.01 ms  (note that symmetric pad here uses 14 FC frames!)
          6, K=29, S=1, FC=1, GC= 1 * (2^3) = 8 * 0.01 ms ...
      quantize: Bool flag whether to quantize the Convolutional blocks.
      layer_idx (int, optional): can be specified to allow layer output capture for InterCTC loss. Defaults to -1.
class_docstr_tok: ["Constructs","a","single","``","Jasper","''","block",".","With","modified","parameters",",","also","constructs","other","blocks","for","models","such","as","`","QuartzNet","`","and","`","Citrinet","`",".","-","For","`","Jasper","`",":","`","separable","`","flag","should","be","False","-","For","`","QuartzNet","`",":","`","separable","`","flag","should","be","True","-","For","`","Citrinet","`",":","`","separable","`","flag","and","`","se","`","flag","should","be","True","Note","that","above","are","general","distinctions",",","each","model","has","intricate","differences","that","expand","over","multiple","such","blocks",".","For","further","information","about","the","differences","between","models","which","use","JasperBlock",",","please","review","the","configs","for","ASR","models","found","in","the","ASR","examples","directory",".","Args",":","inplanes",":","Number","of","input","channels",".","planes",":","Number","of","output","channels",".","repeat",":","Number","of","repeated","sub-blocks","(","R",")","for","this","block",".","kernel_size",":","Convolution","kernel","size","across","all","repeated","sub-blocks",".","kernel_size_factor",":","Floating","point","scale","value","that","is","multiplied","with","kernel","size",",","then","rounded","down","to","nearest","odd","integer","to","compose","the","kernel","size",".","Defaults","to","1.0.","stride",":","Stride","of","the","convolutional","layers",".","dilation",":","Integer","which","defined","dilation","factor","of","kernel",".","Note","that","when","dilation",">","1",",","stride","must","be","equal","to","1.","padding",":","String","representing","type","of","padding",".","Currently","only","supports","``","same","''","padding",",","which","symmetrically","pads","the","input","tensor","with","zeros",".","dropout",":","Floating","point","value",",","determins","percentage","of","output","that","is","zeroed","out",".","activation",":","String","representing","activation","functions",".","Valid","activation","functions","are",":","{","``","hardtanh","''",":","nn.Hardtanh",",","``","relu","''",":","nn.ReLU",",","``","selu","''",":","nn.SELU",",","``","swish","''",":","Swish","}",".","Defaults","to","``","relu","''",".","residual",":","Bool","that","determined","whether","a","residual","branch","should","be","added","or","not",".","All","residual","branches","are","constructed","using","a","pointwise","convolution","kernel",",","that","may","or","may","not","perform","strided","convolution","depending","on","the","parameter","`","residual_mode","`",".","groups",":","Number","of","groups","for","Grouped","Convolutions",".","Defaults","to","1.","separable",":","Bool","flag","that","describes","whether","Time-Channel","depthwise","separable","convolution","should","be","constructed",",","or","ordinary","convolution","should","be","constructed",".","heads",":","Number","of","``","heads","''","for","the","masked","convolution",".","Defaults","to","-1",",","which","disables","it",".","normalization",":","String","that","represents","type","of","normalization","performed",".","Can","be","one","of","``","batch","''",",","``","group","''",",","``","instance","''","or","``","layer","''","to","compute","BatchNorm1D",",","GroupNorm1D",",","InstanceNorm","or","LayerNorm","(","which","are","special","cases","of","GroupNorm1D",")",".","norm_groups",":","Number","of","groups","used","for","GroupNorm","(","if","`","normalization","`","==","``","group","''",")",".","residual_mode",":","String","argument","which","describes","whether","the","residual","branch","should","be","simply","added","(","``","add","''",")","or","should","first","stride",",","then","add","(","``","stride_add","''",")",".","Required","when","performing","stride","on","parallel","branch","as","well","as","utilizing","residual","add",".","residual_panes",":","Number","of","residual","panes",",","used","for","Jasper-DR","models",".","Please","refer","to","the","paper",".","conv_mask",":","Bool","flag","which","determines","whether","to","utilize","masked","convolutions","or","not",".","In","general",",","it","should","be","set","to","True",".","se",":","Bool","flag","that","determines","whether","Squeeze-and-Excitation","layer","should","be","used",".","se_reduction_ratio",":","Integer","value",",","which","determines","to","what","extend","the","hidden","dimension","of","the","SE","intermediate","step","should","be","reduced",".","Larger","values","reduce","number","of","parameters",",","but","also","limit","the","effectiveness","of","SE","layers",".","se_context_window",":","Integer","value","determining","the","number","of","timesteps","that","should","be","utilized","in","order","to","compute","the","averaged","context","window",".","Defaults","to","-1",",","which","means","it","uses","global","context","-","such","that","all","timesteps","are","averaged",".","If","any","positive","integer","is","used",",","it","will","utilize","limited","context","window","of","that","size",".","se_interpolation_mode",":","String","used","for","interpolation","mode","of","timestep","dimension","for","SE","blocks",".","Used","only","if","context","window","is",">","1",".","The","modes","available","for","resizing","are",":","`","nearest","`",",","`","linear","`","(","3D-only",")",",","`","bilinear","`",",","`","area","`",".","stride_last",":","Bool","flag","that","determines","whether","all","repeated","blocks","should","stride","at","once",",","(","stride","of","S^R","when","this","flag","is","False",")","or","just","the","last","repeated","block","should","stride","(","stride","of","S","when","this","flag","is","True",")",".","future_context",":","Int","value","that","determins","how","many","``","right","''","\/","``","future","''","context","frames","will","be","utilized","when","calculating","the","output","of","the","conv","kernel",".","All","calculations","are","done","for","odd","kernel","sizes","only",".","By","default",",","this","is","-1",",","which","is","recomputed","as","the","symmetric","padding","case",".","When","future_context",">","=","0",",","will","compute","the","asymmetric","padding","as","follows",":","(","left","context",",","right","context",")","=","[","K","-","1","-","future_context",",","future_context","]","Determining","an","exact","formula","to","limit","future","context","is","dependent","on","global","layout","of","the","model",".","As","such",",","we","provide","both","``","local","''","and","``","global","''","guidelines","below",".","Local","context","limit","(","should","always","be","enforced",")","-","future","context","should","be","<","=","half","the","kernel","size","for","any","given","layer","-","future","context",">","kernel","size","defaults","to","symmetric","kernel","-","future","context","of","layer","=","number","of","future","frames","*","width","of","each","frame","(","dependent","on","stride",")","Global","context","limit","(","should","be","carefully","considered",")","-","future","context","should","be","layed","out","in","an","ever","reducing","pattern",".","Initial","layers","should","restrict","future","context","less","than","later","layers",",","since","shallow","depth","(","and","reduced","stride",")","means","each","frame","uses","less","amounts","of","future","context",".","-","Beyond","a","certain","point",",","future","context","should","remain","static","for","a","given","stride","level",".","This","is","the","upper","bound","of","the","amount","of","future","context","that","can","be","provided","to","the","model","on","a","global","scale",".","-","future","context","is","calculated","(","roughly",")","as","-","(","2","^","stride",")","*","(","K","\/\/","2",")","number","of","future","frames",".","This","resultant","value","should","be","bound","to","some","global","maximum","number","of","future","seconds","of","audio","(","in","ms",")",".","Note",":","In","the","special","case","where","K","<","future_context",",","it","is","assumed","that","the","kernel","is","too","small","to","limit","its","future","context",",","so","symmetric","padding","is","used","instead",".","Note",":","There","is","no","explicit","limitation","on","the","amount","of","future","context","used",",","as","long","as","K",">","future_context","constraint","is","maintained",".","This","might","lead","to","cases","where","future_context","is","more","than","half","the","actual","kernel","size","K","!","In","such","cases",",","the","conv","layer","is","utilizing","more","of","the","future","context","than","its","current","and","past","context","to","compute","the","output",".","While","this","is","possible","to","do",",","it","is","not","recommended","and","the","layer","will","raise","a","warning","to","notify","the","user","of","such","cases",".","It","is","advised","to","simply","use","symmetric","padding","for","such","cases",".","Example",":","Say","we","have","a","model","that","performs","8x","stride","and","receives","spectrogram","frames","with","stride","of","0.01s",".","Say","we","wish","to","upper","bound","future","context","to","80","ms.","Layer","ID",",","Kernel","Size",",","Stride",",","Future","Context",",","Global","Context","0",",","K=5",",","S=1",",","FC=8",",","GC=","2","*","(","2^0",")","=","2","*","0.01","ms","(","special","case",",","K","<","FC","so","use","symmetric","pad",")","1",",","K=7",",","S=1",",","FC=3",",","GC=","3","*","(","2^0",")","=","3","*","0.01","ms","(","note","that","symmetric","pad","here","uses","3","FC","frames","!",")","2",",","K=11",",","S=2",",","FC=4",",","GC=","4","*","(","2^1",")","=","8","*","0.01","ms","(","note","that","symmetric","pad","here","uses","5","FC","frames","!",")","3",",","K=15",",","S=1",",","FC=4",",","GC=","4","*","(","2^1",")","=","8","*","0.01","ms","(","note","that","symmetric","pad","here","uses","7","FC","frames","!",")","4",",","K=21",",","S=2",",","FC=2",",","GC=","2","*","(","2^2",")","=","8","*","0.01","ms","(","note","that","symmetric","pad","here","uses","10","FC","frames","!",")","5",",","K=25",",","S=2",",","FC=1",",","GC=","1","*","(","2^3",")","=","8","*","0.01","ms","(","note","that","symmetric","pad","here","uses","14","FC","frames","!",")","6",",","K=29",",","S=1",",","FC=1",",","GC=","1","*","(","2^3",")","=","8","*","0.01","ms","...","quantize",":","Bool","flag","whether","to","quantize","the","Convolutional","blocks",".","layer_idx","(","int",",","optional",")",":","can","be","specified","to","allow","layer","output","capture","for","InterCTC","loss",".","Defaults","to","-1","."]
code: def _get_conv(
      self,
      in_channels,
      out_channels,
      kernel_size=11,
      stride=1,
      dilation=1,
      padding=0,
      bias=False,
      groups=1,
      heads=-1,
      separable=False,
      quantize=False,
  ):
      use_mask = self.conv_mask
      if use_mask:
          return MaskedConv1d(
              in_channels,
              out_channels,
              kernel_size,
              stride=stride,
              dilation=dilation,
              padding=padding,
              bias=bias,
              groups=groups,
              heads=heads,
              use_mask=use_mask,
              quantize=quantize,
          )
      else:
          if PYTORCH_QUANTIZATION_AVAILABLE and quantize:
              return quant_nn.QuantConv1d(
                  in_channels,
                  out_channels,
                  kernel_size,
                  stride=stride,
                  dilation=dilation,
                  padding=padding,
                  bias=bias,
                  groups=groups,
              )
          elif not PYTORCH_QUANTIZATION_AVAILABLE and quantize:
              raise ImportError(
                  "pytorch-quantization is not installed. Install from "
                  "https://github.com/NVIDIA/TensorRT/tree/master/tools/pytorch-quantization."
              )
          else:
              return nn.Conv1d(
                  in_channels,
                  out_channels,
                  kernel_size,
                  stride=stride,
                  dilation=dilation,
                  padding=padding,
                  bias=bias,
                  groups=groups,
              )
  
imports: import math
  from typing import Callable, Iterable, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from torch.nn.init import _calculate_correct_fan
  from torch.nn.modules.utils import _single
  from nemo.collections.common.parts.utils import activation_registry
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.classes.mixins.adapter_mixins import AdapterModuleMixin
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling the JasperBlock obj's underlying member method code with example usage: obj._get_conv(in_channels, out_channels, kernel_size, stride, dilation, padding, bias, groups, heads, separable, quantize) and returns: MaskedConv1d, quant_nn, nn