code: def test_from_batchnorm(self):
      num_features = 10
  
      # construct batchnorm
      bn = nn.BatchNorm1d(num_features=num_features)
  
      # update bn stats
      bn.train()
      batch_size = 4
      for _ in range(10):
          _ = bn(torch.rand(batch_size, num_features))
  
      # test eval mode is equivalent
      fused_bn = FusedBatchNorm1d.from_batchnorm(bn)
      bn.eval()
  
      sample_2d = torch.rand(batch_size, num_features)
      assert torch.allclose(bn(sample_2d), fused_bn(sample_2d))
  
      sample_3d = torch.rand(batch_size, num_features, 5)
      assert torch.allclose(bn(sample_3d), fused_bn(sample_3d))
  
file_path: NeMo/tests/collections/asr/test_asr_parts_submodules_batchnorm.py
imports: from collections import OrderedDict
  import pytest
  import torch
  import torch.nn
  from nemo.collections.asr.parts.submodules.batchnorm import FusedBatchNorm1d, replace_bn_with_fused_bn, replace_bn_with_fused_bn_all
label_desc: Use image node_id 2 for calling the TestFusedBatchNorm1d obj's underlying member method code with example usage: obj.test_from_batchnorm() without return types