From f4e3457ac87166ca86d5bd6f9caf4a893fb75543 Mon Sep 17 00:00:00 2001 From: William Chargin Date: Thu, 28 Feb 2019 10:15:58 -0800 Subject: [PATCH] profile: make help links open in new tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Not only is opening in new tabs a better user experience, it’s necessary in notebook contexts so that we don’t try to load the GitHub docs in an iframe, which would fail because GitHub sets `frame-ancestors 'none'`. (When I tested #1914 in Colab, I instinctively Ctrl-clicked the link, thus not hitting this issue.) Test Plan: Tested that in both Jupyter and Colab, clicking on a help link before this change yields a white frame with a “Refused to display…” console error, while after this change it opens the appropriate link in a new tab. Checked statically that each link has `rel="noopener" target="_blank"`: ```shell $ <./tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html tee \ > >(grep 'href=' | grep -Fcv ' >(grep -Fc 'rel="noopener"') \ > >(grep -Fc 'target="_blank"') \ > >/dev/null 6 6 6 ``` wchargin-branch: profile-help-in-new-tab --- .../tf-profile-dashboard.html | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html b/tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html index cf0a9fb31c..0b821fe9ee 100644 --- a/tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html +++ b/tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html @@ -48,7 +48,11 @@

Profiling isn’t supported in Colab yet.

Please see - GitHub issue #1913 + GitHub issue #1913 for more information.

@@ -65,21 +69,39 @@

No profile data was found.

To collect a profile, you need to run your model on Google Cloud TPUs and capture the trace information while your model is running. You may want to check out the - README + README and perhaps the tutorial on how to use the - cloud-tpu-profiler. + cloud-tpu-profiler.

If you’re new to TPUs, and want to find out how to run models, check out the - Quickstart Using a TPU. + Quickstart Using a TPU.

If you think profiling is done properly, please see the page of - Google Cloud TPU Troubleshooting and FAQ + Google Cloud TPU Troubleshooting and FAQ and consider filing an issue on GitHub.