Constructs a SessionEndInfo protobuffer. Creates a summary that contains status information for a completed training session. Should be exported after the training session is completed. One such summary per training session should be created. Each should have a different run. A
(status, end_time_secs=None)
| 150 | |
| 151 | |
| 152 | def session_end_pb(status, end_time_secs=None): |
| 153 | """Constructs a SessionEndInfo protobuffer. |
| 154 | |
| 155 | Creates a summary that contains status information for a completed |
| 156 | training session. Should be exported after the training session is completed. |
| 157 | One such summary per training session should be created. Each should have |
| 158 | a different run. |
| 159 | |
| 160 | Args: |
| 161 | status: A tensorboard.hparams.Status enumeration value denoting the |
| 162 | status of the session. |
| 163 | end_time_secs: float. The time to use as the session end time. Represented |
| 164 | as seconds since the unix epoch. If None uses the current time. |
| 165 | |
| 166 | Returns: |
| 167 | The summary protobuffer mentioned above. |
| 168 | """ |
| 169 | if end_time_secs is None: |
| 170 | end_time_secs = time.time() |
| 171 | |
| 172 | session_end_info = plugin_data_pb2.SessionEndInfo( |
| 173 | status=status, end_time_secs=end_time_secs |
| 174 | ) |
| 175 | return _summary( |
| 176 | metadata.SESSION_END_INFO_TAG, |
| 177 | plugin_data_pb2.HParamsPluginData(session_end_info=session_end_info), |
| 178 | ) |
| 179 | |
| 180 | |
| 181 | def _summary(tag, hparams_plugin_data): |