@@ -44,7 +44,9 @@ https://github.com/pytorch/pytorch#from-source
4444
4545The change you have to make is to replace
4646
47- ` python setup.py install `
47+ ```
48+ python setup.py install
49+ ```
4850
4951with
5052
@@ -61,11 +63,11 @@ Hence, if you modify a python file, you do not need to reinstall pytorch again a
6163
6264For example:
6365- Install local pytorch in ` build develop ` mode
64- - modify your python file torch/__ init__ .py (for example)
66+ - modify your python file ` torch/__init__.py ` (for example)
6567- test functionality
66- - modify your python file torch/__ init__ .py
68+ - modify your python file ` torch/__init__.py `
6769- test functionality
68- - modify your python file torch/__ init__ .py
70+ - modify your python file ` torch/__init__.py `
6971- test functionality
7072
7173You do not need to repeatedly install after modifying python files.
@@ -80,6 +82,25 @@ We recommend removing the `build` directory before rebuilding because
8082setup.py's recompilation checking is not great, and it will often fail
8183to rebuild C code after you modify code in a ` generic ` directory.
8284
85+ #### Managing multiple build trees
86+
87+ One downside to using ` python setup.py develop ` is that your development
88+ version of pytorch will be installed globally on your account (e.g., if
89+ you run ` import torch ` anywhere else, the development version will be
90+ used.
91+
92+ If you want to manage multiple builds of PyTorch, you can make use of
93+ [ conda environments] ( https://conda.io/docs/using/envs.html ) to maintain
94+ separate Python package environments, each of which can be tied to a
95+ specific build of PyTorch. To set one up:
96+
97+ ```
98+ conda create -n pytorch-myfeature
99+ source activate pytorch-myfeature
100+ # if you run python now, torch will NOT be installed
101+ python setup.py build develop
102+ ```
103+
83104#### C++ Development tips
84105
85106When you are developing on the C++ side of things, the environment variables ` DEBUG ` and ` NO_CUDA ` are helpful.
0 commit comments