Exemplo n.º 1
0
 def sample_test_user_list(self, date, node_id, shard_num, node_num):
     user_info_dict = {}
     req = scheduler_server_pb2.Request()
     req.node_idx = node_id
     req.shard_num = shard_num
     req.node_num = node_num
     req.date = date
     call_future = self.stub.SampleUsersToTest.future(req)
     user_info = call_future.result()
     for user in user_info.inst_nums:
         user_info_dict[user.uid] = user.inst_num
     return user_info_dict
Exemplo n.º 2
0
 def get_global_params(self):
     req = scheduler_server_pb2.Request()
     req.node_idx = 0
     req.sample_num = 0
     req.shard_num = 0
     req.node_num = 0
     call_future = self.stub.GetGlobalParams.future(req)
     global_p = call_future.result()
     result_dict = {}
     for param in global_p.global_params:
         result_dict[param.name] = np.array(list(param.weight),
                                            dtype=np.float32)
         result_dict[param.name].shape = param.shape
     return result_dict