class_docstr: 实现了 **PaddlePaddle** 框架训练功能的基本 Driver。
  
  这个类被以下子类继承：
  
  1. :class:`~fastNLP.core.drivers.paddle_driver.PaddleSingleDriver`：实现了使用单卡和 ``cpu`` 训练的具体功能；
  2. :class:`~fastNLP.core.drivers.paddle_driver.PaddleFleetDriver`：实现了使用 ``fleet`` 分布式训练 API 进行集群式分布式训练的具体功能；
  
  .. warning::
  
      您不应当直接初始化该类，然后传入给 ``Trainer``，换句话说，您应当使用该类的子类 ``PaddleSingleDriver`` 和 ``PaddleDDPDriver``，而不是
      该类本身。
  
  .. note::
  
      您可以在使用 ``PaddleSingleDriver`` 和 ``PaddleFleetDriver`` 时使用 ``PaddleDriver`` 提供的接口。
  
  :param model: 训练时使用的 **PaddlePaddle** 模型
  :param fp16: 是否开启混合精度训练
  :param paddle_kwargs:
docstr: 从 ``dataloader`` 中获取参数 ``dataset``, ``batch_sampler``, ``sampler``, ``batch_size``, ``shuffle`` 
  和 ``drop_last`` 。
code: def get_dataloader_args(dataloader: "DataLoader"):
      """
      从 ``dataloader`` 中获取参数 ``dataset``, ``batch_sampler``, ``sampler``, ``batch_size``, ``shuffle``
      和 ``drop_last`` 。
      """
  
      @dataclass
      class Res:
          dataset: Optional[Dataset] = None
          batch_sampler: Optional[BatchSampler] = None
          sampler: Optional[Sampler] = None
          batch_size: Optional[int] = None
          shuffle: Optional[bool] = None
          drop_last: Optional[bool] = None
  
      res = Res()
  
      # paddle 的 DataLoader 一定会有 dataset 属性；
      res.dataset = dataloader.dataset
  
      if dataloader.batch_sampler is not None:
          # 不过在 paddle 中，我们限定了 batch_sampler 不能为 None
          res.batch_sampler = dataloader.batch_sampler
          if hasattr(dataloader.batch_sampler, "batch_size"):
              res.batch_size = getattr(
                  dataloader.batch_sampler, "batch_size"
              )
          # 用户使用的是自己的 batch_sampler 并且其没有 "batch_size" 属性；
          else:
              dataloader_iter = iter(dataloader)
              pre_sample = next(dataloader_iter)
              res.batch_size = pre_sample.shape[0]
  
          if hasattr(dataloader.batch_sampler, "sampler"):
              res.sampler = dataloader.batch_sampler.sampler
              if hasattr(dataloader.batch_sampler.sampler, "shuffle"):
                  res.shuffle = dataloader.batch_sampler.sampler.shuffle
              elif isinstance(
                  dataloader.batch_sampler.sampler, PaddleRandomSampler
              ):
                  res.shuffle = True
              else:
                  res.shuffle = False
          # ReproduceBatchSampler 的情况
          elif hasattr(dataloader.batch_sampler, "batch_sampler"):
              batch_sampler = dataloader.batch_sampler.batch_sampler
              res.sampler = batch_sampler.sampler
              if hasattr(batch_sampler.sampler, "shuffle"):
                  res.shuffle = dataloader.batch_sampler.sampler.shuffle
              elif isinstance(
                  batch_sampler.sampler, PaddleRandomSampler
              ):
                  res.shuffle = True
              else:
                  res.shuffle = False
          else:
              res.sampler = None
              res.shuffle = False
  
          if hasattr(dataloader.batch_sampler, "drop_last"):
              res.drop_last = getattr(
                  dataloader.batch_sampler, "drop_last"
              )
          # 用户使用的是自己的 batch_sampler 并且其没有 "drop_last" 属性；
          else:
              res.drop_last = False
  
      return res
  
imports: import os
  import random
  from typing import Union, Optional, Dict, Any
  from pathlib import Path
  from functools import partial
  from dataclasses import dataclass
  import numpy
  from .utils import _build_fp16_env, optimizer_state_to_device, DummyGradScaler
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
  from fastNLP.core.drivers.driver import Driver
  from fastNLP.core.utils import apply_to_collection, paddle_move_data_to_device
  from fastNLP.core.utils.paddle_utils import _convert_data_device
  from fastNLP.envs import FASTNLP_MODEL_FILENAME, FASTNLP_CHECKPOINT_FILENAME, FASTNLP_GLOBAL_RANK, rank_zero_call
  from fastNLP.core.log import logger
  from fastNLP.core.dataloaders import OverfitDataLoader
  from fastNLP.core.samplers import ReproducibleBatchSampler, ReproducibleSampler, ReproduceBatchSampler, RandomSampler
label_desc: Use image node_id 21 for calling the PaddleDriver obj's underlying member method code with example usage: obj.get_dataloader_args(dataloader) and returns: res