code: def test_transformer_param_number(
      cfg_name, gt_num_params, gt_num_fixed_params
  ):
      cfg = TransformerModel.get_cfg(cfg_name)
      cfg.defrost()
      cfg.MODEL.src_vocab_size = 32768
      cfg.MODEL.tgt_vocab_size = 32768
      cfg.freeze()
      model = TransformerModel.from_cfg(cfg)
      model.initialize()
      num_params, num_fixed_params = count_parameters(
          model.collect_params()
      )
      assert num_params == gt_num_params
      assert num_fixed_params == gt_num_fixed_params
      num_params2, num_fixed_params2 = count_parameters(
          deduplicate_param_dict(model.collect_params())
      )
      assert num_params2 == gt_num_params
      assert num_fixed_params2 == gt_num_fixed_params
  
file_path: gluon-nlp/tests/test_models_transformer.py
imports: import numpy
  import mxnet
  import pytest
  from numpy.testing import assert_allclose
  from gluonnlp.models.transformer import TransformerEncoder, TransformerDecoder, TransformerModel, TransformerInference, transformer_cfg_reg
  from gluonnlp.attention_cell import gen_mem_attn_mask, gen_self_attn_mask
  from gluonnlp.utils.testing import verify_nmt_model, verify_nmt_inference
  from gluonnlp.utils.testing import verify_backbone_fp16
  from gluonnlp.utils.parameter import count_parameters, deduplicate_param_dict
label_desc: Use image node_id 6 for calling a global function with example usage: test_transformer_param_number(cfg_name, gt_num_params, gt_num_fixed_params) without return types