code: def test_pytorch_optimizer_factory():
      model = torch.nn.Linear(2, 1)
      opt_class = dynamic_import_optimizer("adam", "pytorch")
      optimizer = opt_class.build(model.parameters(), lr=0.9)
      for g in optimizer.param_groups:
          assert g["lr"] == 0.9
  
      opt_class = dynamic_import_optimizer("sgd", "pytorch")
      optimizer = opt_class.build(model.parameters(), lr=0.9)
      for g in optimizer.param_groups:
          assert g["lr"] == 0.9
  
      opt_class = dynamic_import_optimizer("adadelta", "pytorch")
      optimizer = opt_class.build(model.parameters(), rho=0.9)
      for g in optimizer.param_groups:
          assert g["rho"] == 0.9
  
file_path: espnet/test/test_optimizer.py
imports: import chainer
  import numpy
  import pytest
  import torch
  from espnet.optimizer.factory import dynamic_import_optimizer
  from espnet.optimizer.pytorch import OPTIMIZER_FACTORY_DICT
label_desc: Use image node_id 2 for calling a global function with example usage: test_pytorch_optimizer_factory() without return types