nshutils 0.7.0__tar.gz → 0.8.0__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.7.0 → nshutils-0.8.0}/PKG-INFO +1 -1
- {nshutils-0.7.0 → nshutils-0.8.0}/pyproject.toml +1 -2
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/__init__.py +2 -0
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/actsave/__init__.py +0 -2
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/actsave/_saver.py +4 -5
- {nshutils-0.7.0 → nshutils-0.8.0}/README.md +0 -0
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/actsave/_loader.py +0 -0
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/collections.py +0 -0
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/logging.py +0 -0
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/snoop.py +0 -0
- {nshutils-0.7.0 → nshutils-0.8.0}/src/nshutils/typecheck.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "nshutils"
|
3
|
-
version = "0.
|
3
|
+
version = "0.8.0"
|
4
4
|
description = ""
|
5
5
|
authors = ["Nima Shoghi <nimashoghi@gmail.com>"]
|
6
6
|
readme = "README.md"
|
@@ -31,7 +31,6 @@ strictListInference = true
|
|
31
31
|
strictDictionaryInference = true
|
32
32
|
strictSetInference = true
|
33
33
|
reportPrivateImportUsage = false
|
34
|
-
ignore = ["./build/"]
|
35
34
|
|
36
35
|
[tool.ruff.lint]
|
37
36
|
ignore = ["F722", "F821", "E731", "E741"]
|
@@ -1,5 +1,7 @@
|
|
1
1
|
from . import actsave as actsave
|
2
2
|
from . import typecheck as typecheck
|
3
|
+
from .actsave import ActLoad as ActLoad
|
4
|
+
from .actsave import ActSave as ActSave
|
3
5
|
from .logging import init_python_logging as init_python_logging
|
4
6
|
from .logging import lovely as lovely
|
5
7
|
from .logging import pretty as pretty
|
@@ -1,6 +1,4 @@
|
|
1
|
-
from ._loader import ActivationLoader as ActivationLoader
|
2
1
|
from ._loader import ActLoad as ActLoad
|
3
2
|
from ._saver import Activation as Activation
|
4
|
-
from ._saver import ActivationSaver as ActivationSaver
|
5
3
|
from ._saver import ActSave as ActSave
|
6
4
|
from ._saver import Transform as Transform
|
@@ -53,11 +53,11 @@ def _to_numpy(activation: Value) -> np.ndarray:
|
|
53
53
|
elif isinstance(activation, np.ndarray):
|
54
54
|
return activation
|
55
55
|
elif isinstance(activation, Tensor):
|
56
|
-
|
57
|
-
if
|
56
|
+
activation_ = activation.detach()
|
57
|
+
if activation_.is_floating_point():
|
58
58
|
# NOTE: We need to convert to float32 because [b]float16 is not supported by numpy
|
59
|
-
|
60
|
-
return
|
59
|
+
activation_ = activation_.float()
|
60
|
+
return activation_.cpu().numpy()
|
61
61
|
else:
|
62
62
|
log.warning(f"Unrecognized activation type {type(activation)}")
|
63
63
|
|
@@ -358,4 +358,3 @@ class ActSaveProvider:
|
|
358
358
|
|
359
359
|
|
360
360
|
ActSave = ActSaveProvider()
|
361
|
-
ActivationSaver = ActSave
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|