code: def test_svae_training_pipeline(
      self, svae, train_dataset, training_configs
  ):
      dir_path = training_configs.output_dir
  
      # build pipeline
      pipeline = TrainingPipeline(
          model=svae, training_config=training_configs
      )
  
      assert (
          pipeline.training_config.__dict__ == training_configs.__dict__
      )
  
      # Launch Pipeline
      pipeline(
          train_data=train_dataset.data,  # gives tensor to pipeline
          eval_data=train_dataset.data,  # gives tensor to pipeline
      )
  
      model = deepcopy(pipeline.trainer._best_model)
  
      training_dir = os.path.join(
          dir_path,
          f"SVAE_training_{pipeline.trainer._training_signature}",
      )
      assert os.path.isdir(training_dir)
  
      final_dir = os.path.join(training_dir, f"final_model")
      assert os.path.isdir(final_dir)
  
      files_list = os.listdir(final_dir)
  
      assert set(
          ["model.pt", "model_config.json", "training_config.json"]
      ).issubset(set(files_list))
  
      # check pickled custom decoder
      if not svae.model_config.uses_default_decoder:
          assert "decoder.pkl" in files_list
  
      else:
          assert not "decoder.pkl" in files_list
  
      # check pickled custom encoder
      if not svae.model_config.uses_default_encoder:
          assert "encoder.pkl" in files_list
  
      else:
          assert not "encoder.pkl" in files_list
  
      # check reload full model
      model_rec = AutoModel.load_from_folder(os.path.join(final_dir))
  
      assert all(
          [
              torch.equal(
                  model_rec.state_dict()[key].cpu(),
                  model.state_dict()[key].cpu(),
              )
              for key in model.state_dict().keys()
          ]
      )
  
      assert type(model_rec.encoder.cpu()) == type(model.encoder.cpu())
      assert type(model_rec.decoder.cpu()) == type(model.decoder.cpu())
  
imports: import os
  from copy import deepcopy
  import pytest
  import torch
  from pythae.customexception import BadInheritanceError
  from pythae.models import SVAE, AutoModel, SVAEConfig
  from pythae.models.base.base_utils import ModelOutput
  from pythae.pipelines import GenerationPipeline, TrainingPipeline
  from pythae.samplers import HypersphereUniformSamplerConfig
  from pythae.trainers import BaseTrainer, BaseTrainerConfig
  from tests.data.custom_architectures import Decoder_AE_Conv, Encoder_SVAE_Conv, NetBadInheritance
label_desc: Use image node_id 12 for calling the Test_SVAE_Training obj's underlying member method code with example usage: obj.test_svae_training_pipeline(svae, train_dataset, training_configs) without return types