nshutils 0.22.1__tar.gz → 0.22.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nshutils-0.22.1 → nshutils-0.22.2}/PKG-INFO +1 -1
- {nshutils-0.22.1 → nshutils-0.22.2}/pyproject.toml +1 -1
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/_monkey_patch_all.py +11 -12
- {nshutils-0.22.1 → nshutils-0.22.2}/README.md +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/__init__.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/__init__.pyi +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/actsave/__init__.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/actsave/_loader.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/actsave/_saver.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/collections.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/display.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/logging.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/__init__.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/_base.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/config.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/jax_.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/numpy_.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/torch_.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/lovely/utils.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/snoop.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/typecheck.py +0 -0
- {nshutils-0.22.1 → nshutils-0.22.2}/src/nshutils/util.py +0 -0
@@ -41,21 +41,20 @@ def monkey_patch(libraries: list[Library] | Literal["auto"] = "auto"):
|
|
41
41
|
|
42
42
|
with contextlib.ExitStack() as stack:
|
43
43
|
for library in libraries:
|
44
|
-
|
45
|
-
|
46
|
-
from .torch_ import torch_monkey_patch
|
44
|
+
if library == "torch":
|
45
|
+
from .torch_ import torch_monkey_patch
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
stack.enter_context(torch_monkey_patch())
|
48
|
+
elif library == "jax":
|
49
|
+
from .jax_ import jax_monkey_patch
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
stack.enter_context(jax_monkey_patch())
|
52
|
+
elif library == "numpy":
|
53
|
+
from .numpy_ import numpy_monkey_patch
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
stack.enter_context(numpy_monkey_patch())
|
56
|
+
else:
|
57
|
+
assert_never(library)
|
59
58
|
|
60
59
|
log.info(
|
61
60
|
f"Monkey patched libraries: {', '.join(libraries)}. "
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|