コード例 #1
0
 def _build_session(self, session_name, infos_tuple):
     assert isinstance(infos_tuple, self._SessionInfoTuple)
     assert infos_tuple.start_info is not None
     result = api_pb2.Session(
         name=session_name,
         start_time_secs=infos_tuple.start_info.start_time_secs,
         model_uri=infos_tuple.start_info.model_uri,
         metric_values=self._build_session_metric_values(session_name),
         monitor_url=infos_tuple.start_info.monitor_url)
     if infos_tuple.end_info is not None:
         result.status = infos_tuple.end_info.status
         result.end_time_secs = infos_tuple.end_info.end_time_secs
     return result
コード例 #2
0
  def _build_session(self, name, start_info, end_info):
    """Builds a session object."""

    assert start_info is not None
    result = api_pb2.Session(
        name=name,
        start_time_secs=start_info.start_time_secs,
        model_uri=start_info.model_uri,
        metric_values=self._build_session_metric_values(name),
        monitor_url=start_info.monitor_url)
    if end_info is not None:
      result.status = end_info.status
      result.end_time_secs = end_info.end_time_secs
    return result