code: def test_save_restore_nested_model(self):
      with tempfile.TemporaryDirectory() as tmp_dir:
          model = NestedRNNTModel(cfg=DictConfig({}), trainer=None)
          path = os.path.join(tmp_dir, "rnnt_bpe.nemo")
          model.save_to(path)
  
          new_model = NestedRNNTModel.restore_from(
              path, map_location="cpu"
          )
          assert model.__class__.__name__ == NestedRNNTModel.__name__
          assert (
              new_model.__class__.__name__ == NestedRNNTModel.__name__
          )
          assert isinstance(new_model, type(model))
  
          assert new_model.inner_model.vocab_path.endswith("_vocab.txt")
          assert (
              len(new_model.inner_model.tokenizer.tokenizer.get_vocab())
              == 1024
          )
  
          # Unpack the nemo file
          NestedRNNTModel._save_restore_connector._unpack_nemo_file(
              path, tmp_dir
          )
  
          # Check size of the checkpoint, which contains weights from pretrained model + linear layer
          fp_weights = os.path.join(tmp_dir, "model_weights.ckpt")
          assert os.path.getsize(fp_weights) > 50 * (
              2**20
          )  # Assert the weights are more than 50 MB
  
          # Check if param after restoration is exact match
          original_state_dict = model.inner_model.state_dict()
          new_state_dict = new_model.inner_model.state_dict()
  
          for (old_name, old_param), (new_name, new_param) in zip(
              original_state_dict.items(), new_state_dict.items()
          ):
              assert old_name == new_name
              assert (old_param - new_param).float().abs().mean() < 1e-6
  
imports: import os
  import shutil
  import tempfile
  import pytest
  import torch
  from omegaconf import DictConfig
  from nemo.collections.asr.models import ASRModel
  from nemo.collections.asr.models.rnnt_bpe_models import EncDecRNNTBPEModel
  from nemo.collections.asr.parts.submodules import rnnt_beam_decoding
  from nemo.collections.asr.parts.submodules import rnnt_greedy_decoding
  from nemo.collections.common import tokenizers
  from nemo.core.utils import numba_utils
  from nemo.core.utils.numba_utils import __NUMBA_MINIMUM_VERSION__
label_desc: Use image node_id 8 for calling the TestEncDecRNNTBPEModel obj's underlying member method code with example usage: obj.test_save_restore_nested_model() without return types