Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/main/beginner_source/template_tutorial.py
Views: 712
# -*- coding: utf-8 -*-12"""3Template Tutorial4=================56**Author:** `FirstName LastName <https://github.com/username>`_78.. grid:: 2910.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn11:class-card: card-prerequisites1213* Item 114* Item 215* Item 31617.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites18:class-card: card-prerequisites1920* PyTorch v2.0.021* GPU ???22* Other items 32324If you have a video, add it here like this:2526.. raw:: html2728<div style="margin-top:10px; margin-bottom:10px;">29<iframe width="560" height="315" src="https://www.youtube.com/embed/IC0_FRiX-sw" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>30</div>3132To test your tutorial locally, you can do one of the following:3334* You can control specific files that generate the results by using35``GALLERY_PATTERN`` environment variable. The GALLERY_PATTERN variable36respects regular expressions.37For example to run only ``neural_style_transfer_tutorial.py``,38use the following command:3940.. code-block:: sh4142GALLERY_PATTERN="neural_style_transfer_tutorial.py" make html4344or4546.. code-block:: sh4748GALLERY_PATTERN="neural_style_transfer_tutorial.py" sphinx-build . _build4950* Make a copy of this repository and add only your51tutorial to the `beginner_source` directory removing all other tutorials.52Then run ``make html``.5354Verify that all outputs were generated correctly in the created HTML.55"""5657#########################################################################58# Overview59# --------60#61# Describe Why is this topic important? Add Links to relevant research papers.62#63# This tutorial walks you through the process of....64#65# Steps66# -----67#68# Example code (the output below is generated automatically):69#70import torch71x = torch.rand(5, 3)72print(x)7374######################################################################75# (Optional) Additional Exercises76# -------------------------------77#78# Add additional practice exercises for users to test their knowledge.79# Example: `NLP from Scratch <https://pytorch.org/tutorials/intermediate/char_rnn_generation_tutorial.html#exercises>`__.80#8182######################################################################83# Conclusion84# ----------85#86# Summarize the steps and concepts covered. Highlight key takeaways.87#88# Further Reading89# ---------------90#91# * Link192# * Link293949596