Skip to content

Commit 2bc1d05

Browse files
authored
Revise tutorial running instructions (#46)
1 parent 69be7e4 commit 2bc1d05

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,29 @@ Some useful options:
7373
```cmake
7474
cmake --build build
7575
```
76-
77-
### Running Tutorials
78-
79-
**Note**: _category_ can be basics, intermediate, advanced and _topic_ would be name of tutorial in snake case.
80-
81-
```bash
82-
./build/tutorials/basics/pytorch_basics/pytorch_basics
83-
84-
# In general
85-
./build/tutorials/{category}/{topic}/{topic}
86-
```
87-
8876
>**_Note for Windows users:_** <br>
8977
>The CMake script downloads the *Release* version of libtorch, so `--config Release` has to be appended to the build command.
9078
>
9179
>**_General Note:_** <br>
9280
>By default all tutorials will be built. If you only want to build one specific tutorial, specify the `target` parameter for the build command. For example to only build the language model tutorial, append `--target language-model` (target name = tutorial foldername with all underscores replaced with hyphens).
9381
82+
### Running Tutorials
83+
1. (**IMPORTANT!**) First change into the tutorial's directory within `build/tutorials`. For example, assuming you are in the `pytorch-cpp` directory and want to change to the pytorch basics tutorial folder:
84+
```bash
85+
cd build/tutorials/basics/pytorch_basics
86+
# In general: cd build/tutorials/{basics|intermediate|advanced}/{tutorial_name}
87+
```
88+
2. Run the executable. Note that the executable's name is the tutorial's foldername with all underscores replaced with hyphens (e.g. for tutorial folder: `pytorch_basics` -> executable name: `pytorch-basics` (or `pytorch-basics.exe` on Windows)). For example, to run the pytorch basics tutorial:<br><br>
89+
**Linux/Mac**
90+
```bash
91+
./pytorch-basics
92+
# In general: ./{tutorial-name}
93+
```
94+
**Windows**
95+
```powershell
96+
.\pytorch-basics.exe
97+
# In general: .\{tutorial-name}.exe
98+
```
9499
## Table of Contents
95100

96101
### 1. Basics

0 commit comments

Comments
 (0)