code: def test_default_model_saving(
      self, tmpdir, model_config_with_input_dim
  ):
      tmpdir.mkdir("dummy_folder")
      dir_path = os.path.join(tmpdir, "dummy_folder")
  
      model = BaseAE(model_config_with_input_dim)
  
      model.save(dir_path=dir_path)
  
      assert set(os.listdir(dir_path)) == set(
          ["model_config.json", "model.pt", "environment.json"]
      )
  
      # reload model
      model_rec = BaseAE.load_from_folder(dir_path)
  
      # check configs are the same
      assert (
          model_rec.model_config.__dict__ == model.model_config.__dict__
      )
  
      assert all(
          [
              torch.equal(
                  model_rec.state_dict()[key], model.state_dict()[key]
              )
              for key in model.state_dict().keys()
          ]
      )
  
file_path: benchmark_VAE/tests/test_baseAE.py
imports: import os
  import shutil
  import pytest
  import torch
  from pythae.customexception import BadInheritanceError
  from pythae.models import BaseAE, BaseAEConfig
  from tests.data.custom_architectures import Decoder_AE_Conv, Encoder_AE_Conv, NetBadInheritance
label_desc: Use image node_id 2 for calling the Test_Model_Saving obj's underlying member method code with example usage: obj.test_default_model_saving(tmpdir, model_config_with_input_dim) without return types