def train_from_dataset(self, program=None, dataset=None, scope=None, thread=0, debug=False, fetch_list=None, fetch_info=None, print_period=100):
    '\n        Train from a pre-defined Dataset. Dataset is defined in paddle.fluid.dataset.\n        Given a program, either a program or compiled program, train_from_dataset will\n        consume all data samples in dataset. Input scope can be given by users. By default,\n        scope is global_scope(). The total number of thread run in training is `thread`.\n        Thread number used in training will be minimum value of threadnum in Dataset and\n        the value of thread in this interface. Debug can be set so that executor will display\n        Run-Time for all operators and the throughputs of current training task.\n        \n        Note: train_from_dataset will destroy all resources created within executor for each run.\n\n        Args:\n            program(Program|CompiledProgram): the program that needs to be run,\n               if not provided, then default_main_program (not compiled) will be used.\n            dataset(paddle.fluid.Dataset): dataset created outside this function,\n               a user should provide a well-defined dataset before calling this function.\n               Please check the document of Dataset if needed.\n            scope(Scope): the scope used to run this program, you can switch it to different scope\n               for each run. default is global_scope\n            thread(int): number of thread a user wants to run in this function. The actual number\n               of thread will be min(Dataset.thread_num, thread)\n            debug(bool): whether a user wants to run train_from_dataset \n            fetch_list(Variable List): fetch variable list, each variable\n                                       will be printed during training\n            fetch_info(String List): print information for each variable\n            print_period(int): the number of mini-batches for each print\n\n        Returns:\n            None\n        \n        Examples:\n        \n            .. code-block:: python\n\n              import paddle.fluid as fluid\n\n              place = fluid.CPUPlace() # you can set place = fluid.CUDAPlace(0) to use gpu\n              exe = fluid.Executor(place)\n              x = fluid.layers.data(name="x", shape=[10, 10], dtype="int64")\n              y = fluid.layers.data(name="y", shape=[1], dtype="int64", lod_level=1)\n              dataset = fluid.DatasetFactory().create_dataset()\n              dataset.set_use_var([x, y])\n              dataset.set_thread(1)\n              filelist = [] # you should set your own filelist, e.g. filelist = ["dataA.txt"]\n              dataset.set_filelist(filelist)\n              exe.run(fluid.default_startup_program())\n              exe.train_from_dataset(program=fluid.default_main_program(),\n                                     dataset=dataset)\n\n        '
    if (dataset == None):
        raise RuntimeError('dataset is need and should be initialized')
    if program._pipeline_opt:
        thread = self._adjust_pipeline_resource(program._pipeline_opt, dataset, thread)
    dataset._prepare_to_run()
    (scope, trainer) = self._prepare_trainer(program=program, dataset=dataset, scope=scope, thread=thread, debug=debug, fetch_list=fetch_list, fetch_info=fetch_info, print_period=print_period)
    trainer._gen_trainer_desc()
    self._dump_debug_info(program=program, trainer=trainer)
    self._default_executor.run_from_dataset(program.desc, scope, dataset.dataset, trainer._desc())
    dataset._finish_to_run()
    return None
Train from a pre-defined Dataset. Dataset is defined in paddle.fluid.dataset.
Given a program, either a program or compiled program, train_from_dataset will
consume all data samples in dataset. Input scope can be given by users. By default,
scope is global_scope(). The total number of thread run in training is `thread`.
Thread number used in training will be minimum value of threadnum in Dataset and
the value of thread in this interface. Debug can be set so that executor will display
Run-Time for all operators and the throughputs of current training task.

Note: train_from_dataset will destroy all resources created within executor for each run.

Args:
    program(Program|CompiledProgram): the program that needs to be run,
       if not provided, then default_main_program (not compiled) will be used.
    dataset(paddle.fluid.Dataset): dataset created outside this function,
       a user should provide a well-defined dataset before calling this function.
       Please check the document of Dataset if needed.
    scope(Scope): the scope used to run this program, you can switch it to different scope
       for each run. default is global_scope
    thread(int): number of thread a user wants to run in this function. The actual number
       of thread will be min(Dataset.thread_num, thread)
    debug(bool): whether a user wants to run train_from_dataset 
    fetch_list(Variable List): fetch variable list, each variable
                               will be printed during training
    fetch_info(String List): print information for each variable
    print_period(int): the number of mini-batches for each print

Returns:
    None

Examples:

    .. code-block:: python

      import paddle.fluid as fluid

      place = fluid.CPUPlace() # you can set place = fluid.CUDAPlace(0) to use gpu
      exe = fluid.Executor(place)
      x = fluid.layers.data(name="x", shape=[10, 10], dtype="int64")
      y = fluid.layers.data(name="y", shape=[1], dtype="int64", lod_level=1)
      dataset = fluid.DatasetFactory().create_dataset()
      dataset.set_use_var([x, y])
      dataset.set_thread(1)
      filelist = [] # you should set your own filelist, e.g. filelist = ["dataA.txt"]
      dataset.set_filelist(filelist)
      exe.run(fluid.default_startup_program())
      exe.train_from_dataset(program=fluid.default_main_program(),
                             dataset=dataset)
def train_from_dataset(self, program=None, dataset=None, scope=None, thread=0, debug=False, fetch_list=None, fetch_info=None, print_period=100):
    '\n        Train from a pre-defined Dataset. Dataset is defined in paddle.fluid.dataset.\n        Given a program, either a program or compiled program, train_from_dataset will\n        consume all data samples in dataset. Input scope can be given by users. By default,\n        scope is global_scope(). The total number of thread run in training is `thread`.\n        Thread number used in training will be minimum value of threadnum in Dataset and\n        the value of thread in this interface. Debug can be set so that executor will display\n        Run-Time for all operators and the throughputs of current training task.\n        \n        Note: train_from_dataset will destroy all resources created within executor for each run.\n\n        Args:\n            program(Program|CompiledProgram): the program that needs to be run,\n               if not provided, then default_main_program (not compiled) will be used.\n            dataset(paddle.fluid.Dataset): dataset created outside this function,\n               a user should provide a well-defined dataset before calling this function.\n               Please check the document of Dataset if needed.\n            scope(Scope): the scope used to run this program, you can switch it to different scope\n               for each run. default is global_scope\n            thread(int): number of thread a user wants to run in this function. The actual number\n               of thread will be min(Dataset.thread_num, thread)\n            debug(bool): whether a user wants to run train_from_dataset \n            fetch_list(Variable List): fetch variable list, each variable\n                                       will be printed during training\n            fetch_info(String List): print information for each variable\n            print_period(int): the number of mini-batches for each print\n\n        Returns:\n            None\n        \n        Examples:\n        \n            .. code-block:: python\n\n              import paddle.fluid as fluid\n\n              place = fluid.CPUPlace() # you can set place = fluid.CUDAPlace(0) to use gpu\n              exe = fluid.Executor(place)\n              x = fluid.layers.data(name="x", shape=[10, 10], dtype="int64")\n              y = fluid.layers.data(name="y", shape=[1], dtype="int64", lod_level=1)\n              dataset = fluid.DatasetFactory().create_dataset()\n              dataset.set_use_var([x, y])\n              dataset.set_thread(1)\n              filelist = [] # you should set your own filelist, e.g. filelist = ["dataA.txt"]\n              dataset.set_filelist(filelist)\n              exe.run(fluid.default_startup_program())\n              exe.train_from_dataset(program=fluid.default_main_program(),\n                                     dataset=dataset)\n\n        '
    if (dataset == None):
        raise RuntimeError('dataset is need and should be initialized')
    if program._pipeline_opt:
        thread = self._adjust_pipeline_resource(program._pipeline_opt, dataset, thread)
    dataset._prepare_to_run()
    (scope, trainer) = self._prepare_trainer(program=program, dataset=dataset, scope=scope, thread=thread, debug=debug, fetch_list=fetch_list, fetch_info=fetch_info, print_period=print_period)
    trainer._gen_trainer_desc()
    self._dump_debug_info(program=program, trainer=trainer)
    self._default_executor.run_from_dataset(program.desc, scope, dataset.dataset, trainer._desc())
    dataset._finish_to_run()
    return None