code: def test_set_custom_optimizer(
      self,
      model_sample,
      train_dataset,
      training_configs_learning_rate,
      optimizer_config,
  ):
      trainer = AdversarialTrainer(
          model=model_sample,
          train_dataset=train_dataset,
          training_config=training_configs_learning_rate,
      )
  
      trainer.set_autoencoder_optimizer()
      trainer.set_discriminator_optimizer()
  
      assert issubclass(
          type(trainer.autoencoder_optimizer),
          getattr(
              torch.optim, optimizer_config["autoencoder_optimizer_cls"]
          ),
      )
      assert (
          trainer.autoencoder_optimizer.defaults["lr"]
          == training_configs_learning_rate.autoencoder_learning_rate
      )
      if optimizer_config["autoencoder_optimizer_params"] is not None:
          assert all(
              [
                  trainer.autoencoder_optimizer.defaults[key]
                  == optimizer_config["autoencoder_optimizer_params"][
                      key
                  ]
                  for key in optimizer_config[
                      "autoencoder_optimizer_params"
                  ].keys()
              ]
          )
  
      assert issubclass(
          type(trainer.discriminator_optimizer),
          getattr(
              torch.optim,
              optimizer_config["discriminator_optimizer_cls"],
          ),
      )
      assert (
          trainer.discriminator_optimizer.defaults["lr"]
          == training_configs_learning_rate.discriminator_learning_rate
      )
      if optimizer_config["discriminator_optimizer_params"] is not None:
          assert all(
              [
                  trainer.discriminator_optimizer.defaults[key]
                  == optimizer_config["discriminator_optimizer_params"][
                      key
                  ]
                  for key in optimizer_config[
                      "discriminator_optimizer_params"
                  ].keys()
              ]
          )
  
imports: import os
  from copy import deepcopy
  import pytest
  import torch
  from pythae.models import Adversarial_AE, Adversarial_AE_Config
  from pythae.trainers import AdversarialTrainer, AdversarialTrainerConfig
  from tests.data.custom_architectures import *
label_desc: Use image node_id 6 for calling the Test_Build_Optimizer obj's underlying member method code with example usage: obj.test_set_custom_optimizer(model_sample, train_dataset, training_configs_learning_rate, optimizer_config) without return types