Ejemplo n.º 1
0
def MakeScopeSymbol(job_conf_str, parallel_conf_str, is_mirrored):
    job_conf = text_format.Parse(job_conf_str, job_conf_pb.JobConfigProto())
    parallel_conf = text_format.Parse(parallel_conf_str,
                                      placement_pb.ParallelConf())
    return scope_util.MakeInitialScope(job_conf, parallel_conf.device_tag,
                                       list(parallel_conf.device_name),
                                       is_mirrored).symbol_id
Ejemplo n.º 2
0
def InitScopeStack():
    job_conf = job_conf_pb.JobConfigProto()
    job_conf.predict_conf.SetInParent()
    job_conf.job_name = ""
    scope = MakeInitialScope(job_conf, "cpu", ["0:0"], is_mirrored=False)
    global scope_stack_
    scope_stack_ = [scope]
Ejemplo n.º 3
0
 def InitNormalModeScope(self):
     job_conf = job_conf_pb.JobConfigProto()
     job_conf.predict_conf.SetInParent()
     job_conf.job_name = ""
     scope = compiler.MakeInitialScope(job_conf,
                                       "cpu", ["0:0"],
                                       is_mirrored=False)
     self.job_name2current_scope_[""] = scope
Ejemplo n.º 4
0
 def _get_job_conf(self, job_name):
     if job_name in self.job_name2job_conf_:
         return self.job_name2job_conf_[job_name]
     else:
         job_conf = job_conf_proto.JobConfigProto()
         job_conf.job_name = job_name
         job_conf.predict_conf.SetInParent()
         self.job_name2job_conf_[job_name] = job_conf
         return job_conf
Ejemplo n.º 5
0
 def __init__(self, job_func=None, job_config_proto=None, function_attribute=None):
     if job_config_proto is None:
         job_config_proto = job_conf_pb.JobConfigProto()
     if function_attribute is None:
         function_attribute = FunctionAttribute()
     self.job_func = job_func
     self.job_config_proto = job_config_proto
     self.job_config_proto.predict_conf.SetInParent()
     self.function_attribute = function_attribute