code: def test_custom_decoder_model_saving(
      self, tmpdir, model_configs, custom_decoder
  ):
      tmpdir.mkdir("dummy_folder")
      dir_path = dir_path = os.path.join(tmpdir, "dummy_folder")
  
      model = FactorVAE(model_configs, decoder=custom_decoder)
  
      model.state_dict()["encoder.layers.0.0.weight"][0] = 0
  
      model.save(dir_path=dir_path)
  
      assert set(os.listdir(dir_path)) == set(
          [
              "model_config.json",
              "model.pt",
              "decoder.pkl",
              "environment.json",
          ]
      )
  
      # reload model
      model_rec = AutoModel.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()
          ]
      )
  
imports: import os
  from copy import deepcopy
  import pytest
  import torch
  from pythae.customexception import BadInheritanceError
  from pythae.data.preprocessors import DataProcessor
  from pythae.models import AutoModel, FactorVAE, FactorVAEConfig
  from pythae.models.base.base_utils import ModelOutput
  from pythae.pipelines import GenerationPipeline, TrainingPipeline
  from pythae.samplers import GaussianMixtureSamplerConfig, IAFSamplerConfig, MAFSamplerConfig, NormalSamplerConfig, TwoStageVAESamplerConfig
  from pythae.trainers import AdversarialTrainer, AdversarialTrainerConfig, BaseTrainerConfig
  from tests.data.custom_architectures import Decoder_AE_Conv, Encoder_VAE_Conv, NetBadInheritance
label_desc: Use image node_id 3 for calling the Test_Model_Saving obj's underlying member method code with example usage: obj.test_custom_decoder_model_saving(tmpdir, model_configs, custom_decoder) without return types