class_docstr: 实现了 **PaddlePaddle** 框架下在单卡或 ``cpu`` 环境下训练功能的 **Driver**。
  
  :param model: 训练时使用的 **PaddlePaddle** 模型
  :param device: 训练使用的设备
  :param fp16: 是否开启混合精度训练
  :param paddle_kwargs:
      * *gradscaler_kwargs* -- 用于 ``fp16=True`` 时，提供给 :class:`paddle.amp.GradScaler` 的参数。
  :kwargs:
      * *model_wo_auto_param_call* (``bool``) -- 是否关闭在训练时调用我们的 ``auto_param_call`` 函数来自动匹配 batch 和前向函数的参数的行为。
  
      .. note::
  
          关于该参数的详细说明，请参见 :class:`~fastNLP.core.controllers.Trainer` 中的描述；函数 ``auto_param_call`` 详见 :func:`fastNLP.core.utils.auto_param_call`。
class_docstr_tok: ["\u5b9e\u73b0\u4e86","*","*","PaddlePaddle","*","*","\u6846\u67b6\u4e0b\u5728\u5355\u5361\u6216","``","cpu","``","\u73af\u5883\u4e0b\u8bad\u7ec3\u529f\u80fd\u7684","*","*","Driver","*","*","\u3002",":","param","model",":","\u8bad\u7ec3\u65f6\u4f7f\u7528\u7684","*","*","PaddlePaddle","*","*","\u6a21\u578b",":","param","device",":","\u8bad\u7ec3\u4f7f\u7528\u7684\u8bbe\u5907",":","param","fp16",":","\u662f\u5426\u5f00\u542f\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3",":","param","paddle_kwargs",":","*","*","gradscaler_kwargs","*","--","\u7528\u4e8e","``","fp16=True","``","\u65f6\uff0c\u63d0\u4f9b\u7ed9",":","class",":","`","paddle.amp.GradScaler","`","\u7684\u53c2\u6570\u3002",":","kwargs",":","*","*","model_wo_auto_param_call","*","(","``","bool","``",")","--","\u662f\u5426\u5173\u95ed\u5728\u8bad\u7ec3\u65f6\u8c03\u7528\u6211\u4eec\u7684","``","auto_param_call","``","\u51fd\u6570\u6765\u81ea\u52a8\u5339\u914d","batch","\u548c\u524d\u5411\u51fd\u6570\u7684\u53c2\u6570\u7684\u884c\u4e3a\u3002","..","note",":",":","\u5173\u4e8e\u8be5\u53c2\u6570\u7684\u8be6\u7ec6\u8bf4\u660e\uff0c\u8bf7\u53c2\u89c1",":","class",":","`","~fastNLP.core.controllers.Trainer","`","\u4e2d\u7684\u63cf\u8ff0\uff1b\u51fd\u6570","``","auto_param_call","``","\u8be6\u89c1",":","func",":","`","fastNLP.core.utils.auto_param_call","`","\u3002"]
docstr: :return: 训练使用的模型。
docstr_tok: [":","return",":","\u8bad\u7ec3\u4f7f\u7528\u7684\u6a21\u578b\u3002"]
code: def unwrap_model(self):
      """
      :return: 训练使用的模型。
      """
      return self.model
  
imports: import os
  import contextlib
  from typing import Optional, Dict, Union, Callable, Tuple
  from .paddle_driver import PaddleDriver
  from .utils import replace_batch_sampler, replace_sampler
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
  from fastNLP.envs.env import USER_CUDA_VISIBLE_DEVICES
  from fastNLP.core.utils import auto_param_call, get_paddle_gpu_str, get_paddle_device_id
  from fastNLP.core.utils.paddle_utils import _convert_data_device
  from fastNLP.core.utils.utils import _get_fun_msg
  from fastNLP.core.samplers import ReproducibleBatchSampler, ReproduceBatchSampler, ReproducibleSampler, RandomSampler, re_instantiate_sampler
  from fastNLP.core.log import logger
label_desc: Use image node_id 6 for calling the PaddleSingleDriver obj's underlying member method code with example usage: obj.unwrap_model() and returns: self