class_docstr: 用于执行 ``oneflow`` 动态图 cpu 和 单卡 gpu 运算的 ``driver``。
  
  :param model: 传入给 ``Trainer`` 的 ``model`` 参数
  :param device: oneflow.device，当前进程所使用的设备
  :param fp16: 是否开启 fp16；目前动态图的单卡下该参数无效。
  :param oneflow_kwargs:
  :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`。
code: def __init__(
      self,
      model,
      device: "oneflow.device",
      fp16: bool = False,
      oneflow_kwargs: Dict = None,
      **kwargs,
  ):
      cuda_visible_devices = os.environ.get(
          "CUDA_VISIBLE_DEVICES", None
      )
      if cuda_visible_devices == "":
          device = oneflow.device("cpu")
          logger.info(
              "You have set `CUDA_VISIBLE_DEVICES` to '' in system environment variable, and we are gonna to"
              "use `cpu` instead of `gpu` device."
          )
  
      super(OneflowSingleDriver, self).__init__(
          model, fp16=fp16, oneflow_kwargs=oneflow_kwargs, **kwargs
      )
  
      if device is None:
          logger.debug(
              "device is not set, fastNLP will try to automatically get it."
          )
          try:
              device = next(model.parameters()).device
              assert isinstance(device, oneflow.device)
          except:
              raise ValueError(
                  "fastNLP cannot get device automatically, please set device explicitly."
              )
  
      self.model_device = device
  
      self.local_rank = 0
      self.global_rank = 0
      self.world_size = 1
  
file_path: fastNLP/fastNLP/core/drivers/oneflow_driver/single_device.py
imports: import os
  from typing import Dict, Union
  from fastNLP.envs.imports import _NEED_IMPORT_ONEFLOW
  from .oneflow_driver import OneflowDriver
  from fastNLP.core.drivers.oneflow_driver.utils import replace_sampler, replace_batch_sampler
  from fastNLP.core.samplers import ReproducibleBatchSampler, ReproducibleSampler, re_instantiate_sampler, ReproduceBatchSampler
  from fastNLP.core.samplers import RandomSampler
  from fastNLP.core.log import logger
label_desc: Use image node_id 1 to create a new OneflowSingleDriver object from inherited base classes: OneflowDriver with example: obj = OneflowSingleDriver(model, device, fp16, oneflow_kwargs)