Skip to content

Commit 0debfc0

Browse files
committed
Updated Getting Started section
1 parent 267b9f9 commit 0debfc0

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@
44

55
This repository provides tutorial code in C++ for deep learning researchers to learn PyTorch.
66

7-
## How to Build
7+
## Getting Started
88
- Install
99
```
10-
wget https://download.pytorch.org/libtorch/nightly/cpu/libtorch-shared-with-deps-latest.zip
11-
unzip libtorch-shared-with-deps-latest.zip
10+
./scripts.sh install
1211
```
1312
- Build
1413
```
15-
mkdir build
16-
cd build
17-
cmake -DCMAKE_PREFIX_PATH=/absolute/path/to/libtorch ..
18-
make
14+
./scripts.sh build
1915
```
2016

2117
## Table of Contents

scripts.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
function install() {
4+
wget https://download.pytorch.org/libtorch/nightly/cpu/libtorch-shared-with-deps-latest.zip
5+
unzip libtorch-shared-with-deps-latest.zip
6+
rm -rf libtorch-shared-with-deps-latest.zip
7+
}
8+
9+
function build() {
10+
rm -rf build
11+
mkdir build
12+
cd build
13+
cmake -DCMAKE_PREFIX_PATH=$(dirname $(pwd))/libtorch ..
14+
make
15+
}
16+
17+
if [ $1 = "install" ]
18+
then
19+
install
20+
else
21+
build
22+
fi

0 commit comments

Comments
 (0)