blob: 210153e123c1a4582d9309d9016de08e30658283 [file] [log] [blame]
{% extends "!layout.html" %}
{% block extrahead %}
{% if 'getting-started-setup' in pagename%}
<link rel="stylesheet" href="_static/css/progress-bar.css">
<script src="_static/js/progress-bar.js" defer></script>
{% elif 'compiler-delegate-and-partitioner' in pagename%}
<link rel="stylesheet" href="../_static/css/progress-bar.css">
<script src="../_static/js/progress-bar.js" defer></script>
{% elif 'xtensa' in pagename%}
<link rel="stylesheet" href="../_static/css/progress-bar.css">
<script src="../_static/js/progress-bar.js" defer></script>
{% elif 'qualcomm-ai-engine-direct-backend' in pagename%}
<link rel="stylesheet" href="../_static/css/progress-bar.css">
<script src="../_static/js/progress-bar.js" defer></script>
{% elif 'coreml' in pagename%}
<link rel="stylesheet" href="../_static/css/progress-bar.css">
<script src="../_static/js/progress-bar.js" defer></script>
{% elif 'mps' in pagename%}
<link rel="stylesheet" href="../_static/css/progress-bar.css">
<script src="../_static/js/progress-bar.js" defer></script>
{% endif %}
{{ super() }}
{% endblock %}
{% block sidebartitle %}
<div class="version">
<a href='https://pytorch.org/executorch/versions.html'>{{ version }} &#x25BC</a>
</div>
{% include "searchbox.html" %}
{% endblock %}
{%- block content %}
{% if 'tutorials' in pagename %}
<div class="pytorch-call-to-action-links">
<div id="tutorial-type">{{ pagename }}</div>
<div id="google-colab-link">
<img class="call-to-action-img" src="{{ pathto('_static/images/pytorch-colab.svg', 1) }}" />
<div class="call-to-action-desktop-view">Run in Google Colab</div>
<div class="call-to-action-mobile-view">Colab</div>
</div>
<div id="download-notebook-link">
<img class="call-to-action-notebook-img" src="{{ pathto('_static/images/pytorch-download.svg', 1) }}" />
<div class="call-to-action-desktop-view">Download Notebook</div>
<div class="call-to-action-mobile-view">Notebook</div>
</div>
<div id="github-view-link">
<img class="call-to-action-img" src="{{ pathto('_static/images/pytorch-github.svg', 1) }}" />
<div class="call-to-action-desktop-view">View on GitHub</div>
<div class="call-to-action-mobile-view">GitHub</div>
</div>
</div>
{% endif %}
{{ super() }}
{% endblock %}
<!-- START OF LOCAL OVERRIDE -->
<!-- This block overrides the theme to enable third level left navigation.-->
{% block menu %}
{% if 'singlehtml' not in builder %}
{% set global_toc = toctree(collapse=theme_collapse_navigation|tobool,
includehidden=theme_includehidden|tobool,
titles_only=theme_titles_only|tobool) %}
{% endif %}
{% if global_toc %}
{{ global_toc }}
{% else %}
<!-- Local TOC -->
<div class="local-toc">{{ toc }}</div>
{% endif %}
{% endblock %}
<!-- END OF LOCAL OVERRIDE -->
{% block footer %}
{{ super() }}
<script script type="text/javascript">
var collapsedSections = ['Introduction', 'Getting Started', 'Working with LLMs', 'Exporting to ExecuTorch', 'API Reference', 'IR Specification', 'Compiler Entry Points', 'Runtime', 'Quantization', 'Kernel Library', 'Native Delegates', 'Backend Delegates', 'SDK', 'Tutorials']
</script>
{{ super() }}
<script type="text/javascript">
// Handle the right navigation in third level pages. Without this
// in third level, only the last item always selected. This is a hacky
// way and we should revise it eventually.
// #side-scroll-highlight is disabled in .css.
// Get all menu items
var menuItems = document.querySelectorAll('.pytorch-right-menu a.reference.internal');
// Add a click event listener to each menu item
for (var i = 0; i < menuItems.length; i++) {
menuItems[i].addEventListener('click', function(event) {
// Remove the 'side-scroll-highlight-local' class from all menu items
for (var j = 0; j < menuItems.length; j++) {
menuItems[j].classList.remove('side-scroll-highlight-local');
}
// Add the 'side-scroll-highlight-local' class to the clicked item
event.target.classList.add('side-scroll-highlight-local');
});
}
</script>
{{ super() }}
<script type="text/javascript">
$(document).ready(function () {
// Patch links on interactive tutorial pages to point
// to the correct ExecuTorch URLs.
var downloadNote = $(".sphx-glr-download-link-note.admonition.note");
if (downloadNote.length >= 1) {
var tutorialUrl = $("#tutorial-type").text().substring($("#tutorial-type").text().indexOf("tutorials/") + 9); // 9 is the length of "tutorials/"
var githubLink = "https://github.com/pytorch/executorch/blob/main/docs/source/tutorials_source" + tutorialUrl + ".py",
notebookLink = $(".reference.download")[1].href,
notebookDownloadPath = notebookLink.split('_downloads')[1],
colabLink = "https://colab.research.google.com/github/pytorch/executorch/blob/gh-pages/main/_downloads" + notebookDownloadPath;
$(".pytorch-call-to-action-links a[data-response='Run in Google Colab']").attr("href", colabLink);
$(".pytorch-call-to-action-links a[data-response='View on Github']").attr("href", githubLink);
}
// Patch the "GitHub" link at the top of the page
// to point to the ExecuTorch repo.
var overwrite = function (_) {
if ($(this).length > 0) {
$(this)[0].href = "https://github.com/pytorch/executorch"
}
}
// PC
$(".main-menu a:contains('GitHub')").each(overwrite);
// Overwrite link to Tutorials and Get Started top navigation. If these sections are moved
// this overrides need to be updated.
$(".main-menu a:contains('Tutorials')").attr("href", "https://pytorch.org/executorch/stable/index.html#tutorials-and-examples");
$(".main-menu a:contains('Get Started')").attr("href", "https://pytorch.org/executorch/stable/getting-started-setup.html");
// Mobile
$(".mobile-menu a:contains('Github')").each(overwrite);
// Overwrite link to Tutorials and Get Started top navigation. If these sections are moved
// this overrides need to be updated.
$(".mobile-menu a:contains('Tutorials')").attr("href", "https://pytorch.org/executorch/stable/index.html#tutorials-and-examples");
$(".mobile-menu a:contains('Get Started')").attr("href", "https://pytorch.org/executorch/stable/getting-started-setup.html");
});
</script>
{% endblock %}