Skip to content

Commit 216b6f1

Browse files
author
Jencir Lee
committed
add installation instructions
1 parent 7eee679 commit 216b6f1

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,38 @@ A tiny Autograd engine whose only dependency is NumPy. Implements backpropagatio
99
This version is capable of working with matrices and higher-order tensors. For @karpathy's original scalar-based version, locate the code with tag `scalar`.
1010

1111
## Installation
12+
### For deployment
13+
Outside the micrograd project directory, where you want to deploy it,
14+
1215
```bash
1316
python3 -m venv venv
1417
. venv/bin/activate
15-
pip install .
18+
cd <path-to-micrograd-project>
19+
pip3 install .
20+
```
21+
22+
### For development
23+
One may set up a virtual environment `venv` for running tests under `tests/test_engine.py`, and a separate virtual environment `torch` for running `tests/*.py` including `tests/test_vs_torch.py`. PyTorch shall be installed into the `torch` environment. No need to do `pip3 install .` under either (for running the tests). For example,
24+
25+
```bash
26+
python3 -m venv torch
27+
. torch/bin/activate
28+
29+
# no need to run "pip3 install ."
30+
# but PyTorch need be installed
31+
# into the torch virtual environment
32+
pip3 install torch
33+
```
34+
35+
### For running the demos under `demos/`
36+
Create a third virtual environment `jupyter`. Install the requirements and the micrograd package itself.
37+
38+
```bash
39+
python3 -m venv jupyter
40+
. jupyter/bin/activate
41+
42+
pip3 install .
43+
pip3 install jupyter
1644
```
1745

1846
## Get Started

0 commit comments

Comments
 (0)