-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
511d72c
commit be794c7
Showing
9 changed files
with
111 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ venv/ | |
__pycache__ | ||
*.egg-info | ||
docs/_build/ | ||
docs/generated/ | ||
docs/generated/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from image_utils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
from .im import * | ||
from .standalone_image_utils import * | ||
from .file_utils import * | ||
|
||
def disable(): | ||
from lovely_numpy import lovely, set_config | ||
set_config(repr=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
try: | ||
import torch | ||
import numpy as np | ||
def enable(): | ||
try: | ||
import importlib | ||
if importlib.util.find_spec("numpy") is not None: | ||
import numpy as np | ||
np.set_printoptions(suppress=True, precision=3, threshold=10, edgeitems=2, linewidth=120) | ||
from lovely_numpy import lovely, set_config | ||
set_config(repr=lovely) | ||
|
||
if importlib.util.find_spec("torch") is not None: | ||
import torch | ||
torch.set_printoptions(sci_mode=False, precision=3, threshold=10, edgeitems=2, linewidth=120) | ||
import lovely_tensors as lt | ||
lt.monkey_patch() | ||
except ImportError as e: | ||
print("lovely_tensors is not installed. Run `pip install lovely-tensors` if you wish to use it.") | ||
|
||
torch.set_printoptions(sci_mode=False, precision=3, threshold=10, edgeitems=2, linewidth=120) | ||
np.set_printoptions(suppress=True, precision=3, threshold=10, edgeitems=2, linewidth=120) | ||
import lovely_tensors as lt | ||
from lovely_numpy import lovely, set_config | ||
|
||
lt.monkey_patch() | ||
set_config(repr=lovely) | ||
except ImportError: | ||
print("lovely_tensors is not installed. Run `pip install lovely-tensors` if you wish to use it.") | ||
enable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters