class_docstr: Fused BatchNorm to use in Conformer to improve accuracy in finetuning with TTS scenario
  Drop-in replacement for BatchNorm1d with simple affine projection
class_docstr_tok: ["Fused","BatchNorm","to","use","in","Conformer","to","improve","accuracy","in","finetuning","with","TTS","scenario","Drop-in","replacement","for","BatchNorm1d","with","simple","affine","projection"]
docstr: Construct FusedBatchNorm1d module from BatchNorm1d
  Args:
      bn: original BatchNorm module
  
  Returns:
      FusedBatchNorm1d module with initialized params; in eval mode result is equivalent to original BatchNorm
docstr_tok: ["Construct","FusedBatchNorm1d","module","from","BatchNorm1d","Args",":","bn",":","original","BatchNorm","module","Returns",":","FusedBatchNorm1d","module","with","initialized","params",";","in","eval","mode","result","is","equivalent","to","original","BatchNorm"]
code: def from_batchnorm(cls, bn: nn.BatchNorm1d) -> FusedBatchNorm1d:
      """
      Construct FusedBatchNorm1d module from BatchNorm1d
      Args:
          bn: original BatchNorm module
  
      Returns:
          FusedBatchNorm1d module with initialized params; in eval mode result is equivalent to original BatchNorm
      """
      assert isinstance(bn, nn.BatchNorm1d)
      fused_bn = FusedBatchNorm1d(bn.num_features)
      # init projection params from original batch norm
      # so, for inference mode output is the same
      std = torch.sqrt(bn.running_var.data + bn.eps)
      fused_bn.weight.data = bn.weight.data / std
      fused_bn.bias.data = (
          bn.bias.data - bn.running_mean.data * fused_bn.weight.data
      )
      return fused_bn
  
file_path: NeMo/nemo/collections/asr/parts/submodules/batchnorm.py
imports: from __future__ import annotations
  from functools import reduce
  from typing import List
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the FusedBatchNorm1d obj's underlying member method code with example usage: obj.from_batchnorm(cls, bn) and returns: fused_bn