parameters: (self,
                             executor,
                             scope,
                             program,
                             model_name,
                             output_path,
                             day,
                             pass_id,
                             hadoop_fs_name,
                             hadoop_fs_ugi,
                             hadoop_home="$HADOOP_HOME",
                             var_names=None,
                             save_combine=True)
docstring: save paddle model, and upload to hdfs dnn_plugin path
  
          Args:
              executor(Executor): fluid Executor
              scope(Scope): fluid Scope
              program(Program): fluid Program
              model_name(str): save model local dir or filename
              output_path(str): hdfs/afs output path
              day(str|int): training day
              pass_id(str|int): training pass
              hadoop_fs_name(str): hadoop fs name
              hadoop_fs_ugi(str): hadoop fs ugi
              hadoop_home(str): hadoop home, default is "$HADOOP_HOME"
              var_names(list): save persistable var names, default is None
              save_combine(bool): whether to save in a file or separate files,
                                  default is True
  
          Examples:
              .. code-block:: python
  
                from paddle.fluid.incubate.fleet.utils.fleet_util import FleetUtil
                fleet_util = FleetUtil()
                fleet_util.save_paddle_params(exe,
                                              join_scope,
                                              join_program,
                                              "paddle_dense.model.0",
                                              "hdfs:/my/output/path/",
                                              day=20190727,
                                              pass_id=6,
                                              hadoop_fs_name="xxx",
                                              hadoop_fs_ugi="xxx,xxx",
                                              var_names=join_all_var_names)
                fleet_util.save_paddle_params(exe,
                                              join_scope,
                                              join_program,
                                              "paddle_dense.model.usr.0",
                                              "hdfs:/my/output/path/",
                                              day=20190727,
                                              pass_id=6,
                                              hadoop_fs_name="xxx",
                                              hadoop_fs_ugi="xxx,xxx",
                                              var_names=join_user_var_names)
                fleet_util.save_paddle_params(exe,
                                              join_scope,
                                              join_program,
                                              "paddle_dense.model.item.0",
                                              "hdfs:/my/output/path/",
                                              day=20190727,
                                              pass_id=6,
                                              hadoop_fs_name="xxx",
                                              hadoop_fs_ugi="xxx,xxx",
                                              var_names=join_user_item_names)
docstring_summary: save paddle model, and upload to hdfs dnn_plugin path
docstring_tokens: save paddle model and upload to hdfs dnn_plugin path
function: def save_paddle_params(self,
                             executor,
                             scope,
                             program,
                             model_name,
                             output_path,
                             day,
                             pass_id,
                             hadoop_fs_name,
                             hadoop_fs_ugi,
                             hadoop_home="$HADOOP_HOME",
                             var_names=None,
                             save_combine=True):
          """
          save paddle model, and upload to hdfs dnn_plugin path
  
          Args:
              executor(Executor): fluid Executor
              scope(Scope): fluid Scope
              program(Program): fluid Program
              model_name(str): save model local dir or filename
              output_path(str): hdfs/afs output path
              day(str|int): training day
              pass_id(str|int): training pass
              hadoop_fs_name(str): hadoop fs name
              hadoop_fs_ugi(str): hadoop fs ugi
              hadoop_home(str): hadoop home, default is "$HADOOP_HOME"
              var_names(list): save persistable var names, default is None
              save_combine(bool): whether to save in a file or separate files,
                                  default is True
  
          Examples:
              .. code-block:: python
  
                from paddle.fluid.incubate.fleet.utils.fleet_util import FleetUtil
                fleet_util = FleetUtil()
                fleet_util.save_paddle_params(exe,
                                              join_scope,
                                              join_program,
                                              "paddle_dense.model.0",
                                              "hdfs:/my/output/path/",
                                              day=20190727,
                                              pass_id=6,
                                              hadoop_fs_name="xxx",
                                              hadoop_fs_ugi="xxx,xxx",
                                              var_names=join_all_var_names)
                fleet_util.save_paddle_params(exe,
                                              join_scope,
                                              join_program,
                                              "paddle_dense.model.usr.0",
                                              "hdfs:/my/output/path/",
                                              day=20190727,
                                              pass_id=6,
                                              hadoop_fs_name="xxx",
                                              hadoop_fs_ugi="xxx,xxx",
                                              var_names=join_user_var_names)
                fleet_util.save_paddle_params(exe,
                                              join_scope,
                                              join_program,
                                              "paddle_dense.model.item.0",
                                              "hdfs:/my/output/path/",
                                              day=20190727,
                                              pass_id=6,
                                              hadoop_fs_name="xxx",
                                              hadoop_fs_ugi="xxx,xxx",
                                              var_names=join_user_item_names)
  
          """
          day = str(day)
          pass_id = str(pass_id)
          # pull dense before save
          self.pull_all_dense_params(scope, program)
          if fleet.worker_index() == 0:
              vars = [program.global_block().var(i) for i in var_names]
              with fluid.scope_guard(scope):
                  if save_combine:
                      fluid.io.save_vars(
                          executor, "./", program, vars=vars, filename=model_name)
                  else:
                      fluid.io.save_vars(executor, model_name, program, vars=vars)
  
              configs = {
                  "fs.default.name": hadoop_fs_name,
                  "hadoop.job.ugi": hadoop_fs_ugi
              }
              client = HDFSClient(hadoop_home, configs)
  
              if pass_id == "-1":
                  dest = "%s/%s/base/dnn_plugin/" % (output_path, day)
              else:
                  dest = "%s/%s/delta-%s/dnn_plugin/" % (output_path, day,
                                                         pass_id)
              if not client.is_exist(dest):
                  client.mkdirs(dest)
              client.upload(model_name, dest, multi_processes=5, overwrite=True)
  
          fleet._role_maker._barrier_worker()
function_tokens: def save_paddle_params ( self , executor , scope , program , model_name , output_path , day , pass_id , hadoop_fs_name , hadoop_fs_ugi , hadoop_home = "$HADOOP_HOME" , var_names = None , save_combine = True ) : day = str ( day ) pass_id = str ( pass_id ) # pull dense before save self . pull_all_dense_params ( scope , program ) if fleet . worker_index ( ) == 0 : vars = [ program . global_block ( ) . var ( i ) for i in var_names ] with fluid . scope_guard ( scope ) : if save_combine : fluid . io . save_vars ( executor , "./" , program , vars = vars , filename = model_name ) else : fluid . io . save_vars ( executor , model_name , program , vars = vars ) configs = { "fs.default.name" : hadoop_fs_name , "hadoop.job.ugi" : hadoop_fs_ugi } client = HDFSClient ( hadoop_home , configs ) if pass_id == "-1" : dest = "%s/%s/base/dnn_plugin/" % ( output_path , day ) else : dest = "%s/%s/delta-%s/dnn_plugin/" % ( output_path , day , pass_id ) if not client . is_exist ( dest ) : client . mkdirs ( dest ) client . upload ( model_name , dest , multi_processes = 5 , overwrite = True ) fleet . _role_maker . _barrier_worker ( )