parameters: (self, request)
return_statement: return framework.OnRunEndResponse()
docstring: Overrides on-run-end callback.
  
      Actions taken:
        1) Load the debug dump.
        2) Bring up the Analyzer CLI.
  
      Args:
        request: An instance of OnSessionInitRequest.
  
      Returns:
        An instance of OnSessionInitResponse.
docstring_summary: Overrides on-run-end callback.
docstring_tokens: Overrides on - run - end callback .
function: def on_run_end(self, request):
      """Overrides on-run-end callback.
  
      Actions taken:
        1) Load the debug dump.
        2) Bring up the Analyzer CLI.
  
      Args:
        request: An instance of OnSessionInitRequest.
  
      Returns:
        An instance of OnSessionInitResponse.
      """
  
      self._is_run_start = False
      if request.performed_action == framework.OnRunStartAction.DEBUG_RUN:
        partition_graphs = None
        if request.run_metadata and request.run_metadata.partition_graphs:
          partition_graphs = request.run_metadata.partition_graphs
        elif request.client_graph_def:
          partition_graphs = [request.client_graph_def]
  
        if request.tf_error and not os.path.isdir(self._dump_root):
          # It is possible that the dump root may not exist due to errors that
          # have occurred prior to graph execution (e.g., invalid device
          # assignments), in which case we will just raise the exception as the
          # unwrapped Session does.
          raise request.tf_error
  
        debug_dump = debug_data.DebugDumpDir(
            self._dump_root, partition_graphs=partition_graphs)
        debug_dump.set_python_graph(self._sess.graph)
  
        passed_filter = None
        passed_filter_exclude_node_names = None
        if self._active_tensor_filter:
          if not debug_dump.find(
              self._tensor_filters[self._active_tensor_filter], first_n=1,
              exclude_node_names=self._active_filter_exclude_node_names):
            # No dumped tensor passes the filter in this run. Clean up the dump
            # directory and move on.
            self._remove_dump_root()
            return framework.OnRunEndResponse()
          else:
            # Some dumped tensor(s) from this run passed the filter.
            passed_filter = self._active_tensor_filter
            passed_filter_exclude_node_names = (
                self._active_filter_exclude_node_names)
            self._active_tensor_filter = None
            self._active_filter_exclude_node_names = None
  
        self._prep_debug_cli_for_run_end(
            debug_dump, request.tf_error, passed_filter,
            passed_filter_exclude_node_names)
  
        self._run_start_response = self._launch_cli()
  
        # Clean up the dump generated by this run.
        self._remove_dump_root()
      elif request.performed_action == framework.OnRunStartAction.PROFILE_RUN:
        self._prep_profile_cli_for_run_end(self._sess.graph, request.run_metadata)
        self._run_start_response = self._launch_cli()
      else:
        # No debug information to show following a non-debug run() call.
        self._run_start_response = None
  
      # Return placeholder response that currently holds no additional
      # information.
      return framework.OnRunEndResponse()
function_tokens: def on_run_end ( self , request ) : self . _is_run_start = False if request . performed_action == framework . OnRunStartAction . DEBUG_RUN : partition_graphs = None if request . run_metadata and request . run_metadata . partition_graphs : partition_graphs = request . run_metadata . partition_graphs elif request . client_graph_def : partition_graphs = [ request . client_graph_def ] if request . tf_error and not os . path . isdir ( self . _dump_root ) : # It is possible that the dump root may not exist due to errors that # have occurred prior to graph execution (e.g., invalid device # assignments), in which case we will just raise the exception as the # unwrapped Session does. raise request . tf_error debug_dump = debug_data . DebugDumpDir ( self . _dump_root , partition_graphs = partition_graphs ) debug_dump . set_python_graph ( self . _sess . graph ) passed_filter = None passed_filter_exclude_node_names = None if self . _active_tensor_filter : if not debug_dump . find ( self . _tensor_filters [ self . _active_tensor_filter ] , first_n = 1 , exclude_node_names = self . _active_filter_exclude_node_names ) : # No dumped tensor passes the filter in this run. Clean up the dump # directory and move on. self . _remove_dump_root ( ) return framework . OnRunEndResponse ( ) else : # Some dumped tensor(s) from this run passed the filter. passed_filter = self . _active_tensor_filter passed_filter_exclude_node_names = ( self . _active_filter_exclude_node_names ) self . _active_tensor_filter = None self . _active_filter_exclude_node_names = None self . _prep_debug_cli_for_run_end ( debug_dump , request . tf_error , passed_filter , passed_filter_exclude_node_names ) self . _run_start_response = self . _launch_cli ( ) # Clean up the dump generated by this run. self . _remove_dump_root ( ) elif request . performed_action == framework . OnRunStartAction . PROFILE_RUN : self . _prep_profile_cli_for_run_end ( self . _sess . graph , request . run_metadata ) self . _run_start_response = self . _launch_cli ( ) else : # No debug information to show following a non-debug run() call. self . _run_start_response = None # Return placeholder response that currently holds no additional # information. return framework . OnRunEndResponse ( )