class_docstr: 使用 TorchSingleDriver 测试基类的函数
class_docstr_tok: ["\u4f7f\u7528","TorchSingleDriver","\u6d4b\u8bd5\u57fa\u7c7b\u7684\u51fd\u6570"]
docstr: 测试替换了 batch_sampler 后 get_dataloader_args 的表现
docstr_tok: ["\u6d4b\u8bd5\u66ff\u6362\u4e86","batch_sampler","\u540e","get_dataloader_args","\u7684\u8868\u73b0"]
code: def test_get_dataloader_args_with_randombatchsampler(
      self, batch_size, shuffle, drop_last
  ):
      """
      测试替换了 batch_sampler 后 get_dataloader_args 的表现
      """
      dataset = TorchNormalDataset()
      dataloader = dataloader_with_randombatchsampler(
          dataset, batch_size, shuffle, drop_last
      )
      res = TorchSingleDriver.get_dataloader_args(dataloader)
  
      assert isinstance(res.dataset, TorchNormalDataset)
      assert isinstance(res.batch_sampler, ReproduceBatchSampler)
      if shuffle:
          assert isinstance(res.sampler, torch.utils.data.RandomSampler)
      else:
          assert isinstance(
              res.sampler, torch.utils.data.SequentialSampler
          )
      assert res.shuffle == shuffle
      assert res.batch_size == batch_size
      assert res.drop_last == drop_last
  
imports: import pytest
  from pathlib import Path
  from pkg_resources import parse_version
  from fastNLP.core.drivers.torch_driver.single_device import TorchSingleDriver
  from fastNLP.core.samplers import ReproduceBatchSampler, RandomSampler
  from tests.helpers.models.torch_model import TorchNormalModel_Classification_1
  from tests.helpers.datasets.torch_data import TorchNormalDataset, TorchNormalXYDataset
  from tests.helpers.datasets.paddle_data import PaddleNormalDataset
  from tests.helpers.models.paddle_model import PaddleNormalModel_Classification_1
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE, _NEED_IMPORT_TORCH
  from fastNLP import prepare_torch_dataloader, BucketedBatchSampler
label_desc: Use image node_id 15 for calling the TestTorchDriverFunctions obj's underlying member method code with example usage: obj.test_get_dataloader_args_with_randombatchsampler(batch_size, shuffle, drop_last) without return types