# Sending a PR to pytorch

**URL:** <https://discuss.pytorch.org/t/sending-a-pr-to-pytorch/69456>\
**Category:** Uncategorized\
**Created:** [February 12, 2020, 8:22am UTC](https://discuss.pytorch.org/t/sending-a-pr-to-pytorch/69456 "2020-02-12T08:22:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kl\_divergence](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kl_divergence/32/5069_2.png) [@kl\_divergence](https://discuss.pytorch.org/u/kl_divergence)\
**Post date:** [February 12, 2020, 8:22am UTC](https://discuss.pytorch.org/t/sending-a-pr-to-pytorch/69456/1 "2020-02-12T08:22:33Z")

</div>

I’ve previously contributed to torchvision, pytorch docs but I’ve not contributed to pytorch. My request to send a PR has been approved. I can’t simply clone the forked repo because it has not been compiled (import torch didn’t work) .

Do I need to build Pytorch from source to see the updated change that I do with python code ?

Building it from source hangs my laptop after sometime and it’s very slow. I also want to check first if my change is working or not. What should I do ?

Can you list the minimal steps required?

---

<div class="post-metadata">

**Author:** ![kl\_divergence](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kl_divergence/32/5069_2.png) [@kl\_divergence](https://discuss.pytorch.org/u/kl_divergence)\
**Post date:** [February 12, 2020, 8:58am UTC](https://discuss.pytorch.org/t/sending-a-pr-to-pytorch/69456/2 "2020-02-12T08:58:46Z")

</div>

@ptrblck, could you please suggest?

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [February 12, 2020, 9:12am UTC](https://discuss.pytorch.org/t/sending-a-pr-to-pytorch/69456/3 "2020-02-12T09:12:38Z")

</div>

@tom created a great tutorial on how to fix your first bug in PyTorch (including a video) [here](https://lernapparat.de/fixing-your-first-pytorch-bug/).

---

<div class="post-metadata">

**Author:** ![tom](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/tom/32/3162_2.png) [@tom](https://discuss.pytorch.org/u/tom)\
**Post date:** [February 12, 2020, 10:03am UTC](https://discuss.pytorch.org/t/sending-a-pr-to-pytorch/69456/4 "2020-02-12T10:03:51Z")

</div>

Three quick comments (though we’d really need more context to see where you want input):

- Building and testing PyTorch your changes before submission is essential to a successful PR.
- You may want to skip it for developing the patch, in particular when you are working on Python parts. I sometimes pick the “very quick and very dirty” way of just editing the installed .py files and then incorporating the changes to the source.
- Building PyTorch is quite intense in terms of resources, but the [CONTRIBUTING.md](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md) has hints how to speed up at least rebuilds.
- My personal way of doing things (I think it is in the video) is to use `python3 setup.py build` (even though PyTorch always helpfully reminds me that I’m doing it wrong) and then using the packages in `./build/lib.SOMETHING/` (either with `(cd build/lib.*/ ; ipython3)` or with `PYTHONPATH=./build/lib.SOMETHING python3 test/sometest.py`. In this way of working, you _cannot_ run python from the checkout path because it’ll find the `torch` module there but that won’t find the compiled C extension modules.  
The fancy people have venvs and `setup.py develop` but I never had the ambition for that type of sophistication.

Just give us a shout when there is something specific you want input on.

Best regards

Thomas

---

<div class="post-metadata">

**Author:** ![kl\_divergence](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kl_divergence/32/5069_2.png) [@kl\_divergence](https://discuss.pytorch.org/u/kl_divergence)\
**Post date:** [February 12, 2020, 4:09pm UTC](https://discuss.pytorch.org/t/sending-a-pr-to-pytorch/69456/6 "2020-02-12T16:09:28Z")

</div>

Thanks a lot for your support.
