code: def test_main_train_loop(self, trainer, training_configs):
      start_model_state_dict = deepcopy(trainer.model.state_dict())
  
      trainer.train()
  
      step_1_model_state_dict = deepcopy(trainer.model.state_dict())
  
      # check that weights were updated
      for key in start_model_state_dict.keys():
          if "encoder" in key:
              assert not torch.equal(
                  step_1_model_state_dict[key],
                  start_model_state_dict[key],
              )
  
          if "decoder" in key:
              assert not torch.equal(
                  step_1_model_state_dict[key],
                  start_model_state_dict[key],
              )
  
      # check changed lr with custom schedulers
      if (
          type(trainer.scheduler)
          != torch.optim.lr_scheduler.ReduceLROnPlateau
          and trainer.scheduler is not None
      ):
          assert (
              training_configs.learning_rate
              != trainer.scheduler.get_last_lr()
          )
  
imports: import os
  from copy import deepcopy
  import pytest
  import torch
  from pythae.customexception import ModelError
  from pythae.models import AE, RHVAE, VAE, AEConfig, RHVAEConfig, VAEConfig
  from pythae.trainers import BaseTrainer, BaseTrainerConfig
  from tests.data.custom_architectures import *
label_desc: Use image node_id 12 for calling the Test_Main_Training obj's underlying member method code with example usage: obj.test_main_train_loop(trainer, training_configs) without return types