class_docstr: 使用 JittorSingleDriver 测试基类的函数
class_docstr_tok: ["\u4f7f\u7528","JittorSingleDriver","\u6d4b\u8bd5\u57fa\u7c7b\u7684\u51fd\u6570"]
docstr: 测试对合法的 optimizers 的检查
docstr_tok: ["\u6d4b\u8bd5\u5bf9\u5408\u6cd5\u7684","optimizers","\u7684\u68c0\u67e5"]
code: def test_check_optimizers_legality(self):
      """
      测试对合法的 optimizers 的检查
      """
      # 单个 optimizer
      optimizer = jt.optim.Adam(
          params=self.driver.model.parameters(), lr=0.01
      )
      self.driver.set_optimizers(optimizer)
  
      # optimizer 列表
      optimizers = [
          jt.optim.Adam(params=self.driver.model.parameters(), lr=0.01)
          for i in range(10)
      ]
      self.driver.set_optimizers(optimizers)
  
imports: import pytest
  from copy import deepcopy
  from pathlib import Path
  from fastNLP.core.drivers.jittor_driver import JittorSingleDriver
  from fastNLP.core.samplers import ReproduceBatchSampler, RandomSampler
  from fastNLP.core.dataloaders import JittorDataLoader
  from tests.helpers.models.jittor_model import JittorNormalModel_Classification_1
  from tests.helpers.datasets.jittor_data import JittorNormalDataset, JittorNormalXYDataset
  from tests.helpers.datasets.torch_data import TorchNormalDataset
  from tests.helpers.models.torch_model import TorchNormalModel_Classification_1
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP.envs.imports import _NEED_IMPORT_JITTOR, _NEED_IMPORT_TORCH
label_desc: Use image node_id 2 for calling the TestJittorDriverFunctions obj's underlying member method code with example usage: obj.test_check_optimizers_legality() without return types