Skip to content

Commit

Permalink
Now depend on the official version of PySnooper (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
zasdfgbnm authored May 30, 2019
1 parent 66bc58a commit a5a8d90
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 23 deletions.
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,15 @@ Deploy (only succeed on tagged commits):

[![Build Status](https://zasdfgbnm.visualstudio.com/TorchSnooper/_apis/build/status/deploy-pypi?branchName=master)](https://zasdfgbnm.visualstudio.com/TorchSnooper/_build/latest?definitionId=14&branchName=master)

Are you having dtype or device errors like `RuntimeError: Expected object of scalar type Double but got scalar type Float`, and feeling it is troublesome to figure out where in you code the mistake starts?
Do you want to look at the shape/dtype/etc. of every step of you model, but tired of manually writing prints?

Are you getting output of unexpected shape, but you don't know where in your function went wrong?
Are you bothered by errors like `RuntimeError: Expected object of scalar type Double but got scalar type Float`, and want to quickly figure out the problem?

TorchSnooper is a [PySnooper](https://github.com/cool-RR/PySnooper) plugin that helps you debugging these errors.
TorchSnooper is a [PySnooper](https://github.com/cool-RR/PySnooper) extension that helps you debugging these errors.

To use TorchSnooper, you just use it like using PySnooper. Remember to replace the `pysnooper.snoop` with `torchsnooper.snoop` in your code.

This project is currently in a very early stage. To install, first install my temporary custom version of PySnooper:

```
pip install --upgrade git+https://github.com/zasdfgbnm/PySnooper.git
```

This temporary fork is mainly to be able to use `custom_repr` before https://github.com/cool-RR/PySnooper/pull/126 get approved and merged.

After installing the custom PySnooper, the next step would be to install TorchSnooper.
To install:

```
pip install torchsnooper
Expand Down
3 changes: 0 additions & 3 deletions azure/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ steps:
- script: 'pip install --upgrade pip'
displayName: 'Upgrade pip'

- script: 'pip install git+https://github.com/zasdfgbnm/PySnooper.git'
displayName: 'Install dependencies'

- script: 'pip install setuptools wheel twine'
displayName: 'Install dependencies'

Expand Down
5 changes: 1 addition & 4 deletions azure/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@ steps:
- script: 'pip install --upgrade pip'
displayName: 'Upgrade pip'

- script: 'pip install git+https://github.com/zasdfgbnm/PySnooper.git'
displayName: 'Install dependencies'

- script: 'pip install flake8 && flake8 .'
- script: 'pip install flake8 && pip install . && flake8 .'
displayName: Flake8
3 changes: 0 additions & 3 deletions azure/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@ steps:
- script: 'pip install --upgrade pip'
displayName: 'Upgrade pip'

- script: 'pip install git+https://github.com/zasdfgbnm/PySnooper.git'
displayName: 'Install dependencies'

- script: 'pip install . && python setup.py test'
displayName: Run test
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use_scm_version=True,
setup_requires=['setuptools_scm'],
install_requires=[
'pysnooper',
'pysnooper>=0.1.0',
],
tests_require=[
'pytest',
Expand Down

0 comments on commit a5a8d90

Please sign in to comment.