def _create_response(self, session_groups):
     return api_pb2.ListSessionGroupsResponse(
         session_groups=session_groups[self._request.start_index:self.
                                       _request.start_index +
                                       self._request.slice_size],
         total_size=len(session_groups),
     )
Ejemplo n.º 2
0
 def _run_handler(self, experiment, session_groups, response_format):
     experiment_proto = text_format.Merge(experiment, api_pb2.Experiment())
     session_groups_proto = text_format.Merge(
         session_groups, api_pb2.ListSessionGroupsResponse())
     num_columns = len(experiment_proto.hparam_infos) + len(
         experiment_proto.metric_infos)
     handler = download_data.Handler(
         backend_context.Context(self._mock_tb_context),
         experiment_proto,
         session_groups_proto,
         response_format,
         [True] * num_columns,
     )
     return handler.run()