Skip to content

Commit

Permalink
🚸 Disable JIT by default
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-rozet committed Mar 11, 2021
1 parent 2e42c66 commit f467070
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,24 @@ l = ssim(x, y, kernel=kernel, channel_avg=False)

Most functional components of `piqa` support PyTorch's JIT, *i.e.* [TorchScript](https://pytorch.org/docs/stable/jit.html), which is a way to create serializable and optimizable functions from PyTorch code.

By default, jitting is enabled for those components. To disable it, the `PIQA_JIT` environment variable has to be set to `0`. To do so temporarily,
By default, jitting is disabled for those components. To enable it, the `PIQA_JIT` environment variable has to be set to `1`. To do so temporarily,

* UNIX-like `bash`

```bash
export PIQA_JIT=0
export PIQA_JIT=1
```

* Windows `cmd`

```cmd
set PIQA_JIT=0
set PIQA_JIT=1
```

* Microsoft `PowerShell`

```powershell
$env:PIQA_JIT=0
$env:PIQA_JIT=1
```

### Assert
Expand Down
2 changes: 1 addition & 1 deletion docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source ~/piqa/bin/activate
git checkout master

# Generate HTML
PIQA_JIT=0 pdoc piqa --html --force \
pdoc piqa --html --force \
--config "git_link_template='https://github.com/francois-rozet/piqa/blob/{commit}/{path}#L{start_line}-L{end_line}'" \
--config "show_inherited_members=True" \
--config "latex_math=True"
Expand Down
2 changes: 1 addition & 1 deletion piqa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
specific image quality assessement metric.
"""

__version__ = '1.1.1'
__version__ = '1.1.2'

from .tv import TV
from .psnr import PSNR
Expand Down
6 changes: 3 additions & 3 deletions piqa/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from typing import List, Tuple


if os.getenv('PIQA_JIT') == '0':
_jit = lambda f: f
else:
if os.getenv('PIQA_JIT') == '1':
_jit = torch.jit.script
else:
_jit = lambda f: f


def _debug(mode: bool = __debug__) -> bool:
Expand Down

0 comments on commit f467070

Please sign in to comment.