def retrieve_tensor_hits(self, tensor_name, graph_name):
        """
        Retrieve tensor hit information.

        Args:
            tensor_name (str): The tensor name from UI.
            graph_name (str): The graph name.

        Returns:
            dict, tensor hit info.
        """
        if self.cache_store.get_stream_handler(
                Streams.METADATA).state != ServerStatus.WAITING.value:
            log.error(
                "Failed to get tensor hits as the MindSpore is not in waiting state."
            )
            raise DebuggerTensorHitError
        log.info("Retrieve tensor hits for %s from %s", tensor_name,
                 graph_name)
        watch_points = TensorDetailInfo(
            self.cache_store).get_tensor_watch_points(tensor_name, graph_name)
        return {'watch_points': watch_points}
    def retrieve_tensor_graph(self, tensor_name, graph_name):
        """
        Retrieve tensor graph.

        Args:
            tensor_name (str): The tensor name from UI.
            graph_name (str): The graph name.

        Returns:
            dict, tensor graph object.
        """
        if self.cache_store.get_stream_handler(
                Streams.METADATA).state != ServerStatus.WAITING.value:
            log.error(
                "Failed to get tensor graph the MindSpore is not in waiting state."
            )
            raise DebuggerTensorGraphError
        log.info("Retrieve tensor graph for %s from %s", tensor_name,
                 graph_name)
        tensor_graph_ops = TensorDetailInfo(self.cache_store).get_tensor_graph(
            tensor_name, graph_name)
        return tensor_graph_ops