code: def test_pytorch_scheduler():
      warmup = 30000
      s = scheduler.NoamScheduler.build("lr", warmup=warmup)
      net = torch.nn.Linear(2, 1)
      o = torch.optim.SGD(net.parameters(), lr=1.0)
      so = PyTorchScheduler([s], o)
      so.step(0)
      for g in o.param_groups:
          assert g["lr"] == s.scale(0)
  
      so.step(warmup)
      for g in o.param_groups:
          numpy.testing.assert_allclose(g["lr"], 1.0, rtol=1e-4)
  
file_path: espnet/test/test_scheduler.py
imports: import chainer
  import numpy
  import pytest
  import torch
  from espnet.scheduler import scheduler
  from espnet.scheduler.chainer import ChainerScheduler
  from espnet.scheduler.pytorch import PyTorchScheduler
label_desc: Use image node_id 2 for calling a global function with example usage: test_pytorch_scheduler() without return types