code: def test_create_optimizer(tmp_path):
      wrapper = TorchImageClassificationWrapper(
          "resnet18", {}, tmp_path
      )
      wrapper._create_model(num_classes=10)
  
      # default
      default_optimizer = wrapper._create_optimizer()
      assert isinstance(default_optimizer, optim.Optimizer)
  
      # adadelta
      wrapper.config["optimizer"] = "adadelta"
      adadelta = wrapper._create_optimizer()
      assert isinstance(adadelta, optim.Adadelta)
  
      # adadelta with lr
      wrapper.config["optimizer"] = "adadelta"
      wrapper.config["lr"] = 123
      adadelta_lr = wrapper._create_optimizer()
      assert isinstance(adadelta, optim.Adadelta)
      assert adadelta_lr.defaults["lr"] == 123
  
      # unknown optimizer
      wrapper.config["optimizer"] = "unknown-optimizer123"
      with pytest.raises(ValueError):
          wrapper._create_optimizer()
  
file_path: traintool/tests/image_classification/test_torch_models.py
imports: import comet_ml
  import pytest
  import numpy
  import torch.nn
  from torch import optim
  from tensorboardX import SummaryWriter
  from conftest import create_dataset, create_image
  from traintool.image_classification.torch_models import TorchImageClassificationWrapper, SimpleCnn
  from traintool.utils import DummyExperiment
label_desc: Use image node_id 3 for calling a global function with example usage: test_create_optimizer(tmp_path) without return types