nshutils 0.7.0__py3-none-any.whl → 0.8.0__py3-none-any.whl

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/__init__.py CHANGED
@@ -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
- activation = activation.detach()
57
- if activation.is_floating_point():
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
- activation = activation.float()
60
- return activation.cpu().numpy()
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nshutils
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary:
5
5
  Author: Nima Shoghi
6
6
  Author-email: nimashoghi@gmail.com
@@ -0,0 +1,11 @@
1
+ nshutils/__init__.py,sha256=ZRdp3KcreswdrusXOGc8aEI07qfBCYQGJYC7NqZ5WPI,324
2
+ nshutils/actsave/__init__.py,sha256=6gJ49011Ad3kS8BejeZRPj7ZyVyIcmX-VKLEmYZyGM8,167
3
+ nshutils/actsave/_loader.py,sha256=fAhD32DrJa4onkYfcwc21YIeGEYzOSXCK_HVo9SZLgQ,4604
4
+ nshutils/actsave/_saver.py,sha256=M7PwFy6faefEDG9hbclbWUNGi1yX7ZjzshdFdmsrtyk,9890
5
+ nshutils/collections.py,sha256=EE_qLd-LrsX5lsyk9GSKh03Q8bhn9CHB3jiEeNj4uF4,5197
6
+ nshutils/logging.py,sha256=tL-6XvdvJEEr7bje9DSmUBpm6pnJS9XG_1fuw3U1eME,2573
7
+ nshutils/snoop.py,sha256=2RNlOcBFnCUyOsfGlbBb8FwSGq03hxfypMfqMA0No-A,7356
8
+ nshutils/typecheck.py,sha256=_KtfinRy9A0Dgq78kN5MGGrefvb6jn2tGY6svdLEBAs,4915
9
+ nshutils-0.8.0.dist-info/METADATA,sha256=X5yqqnQA1Pin9-1VvhClw3l7YggpoMAZVUtg3l77LGk,517
10
+ nshutils-0.8.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
11
+ nshutils-0.8.0.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- nshutils/__init__.py,sha256=1hxTdQ-e1ym76tdrSAaYoU4Qq5IUt1DRShi7khn7vs8,244
2
- nshutils/actsave/__init__.py,sha256=kafzChiViTeOY28GnwKD6yBJfiB7aSU8t1u5cZicdmc,280
3
- nshutils/actsave/_loader.py,sha256=fAhD32DrJa4onkYfcwc21YIeGEYzOSXCK_HVo9SZLgQ,4604
4
- nshutils/actsave/_saver.py,sha256=1ER49Xan9DZ8H1bf3mJGqCFCfu8wnYv7PXlOPD1O-AY,9911
5
- nshutils/collections.py,sha256=EE_qLd-LrsX5lsyk9GSKh03Q8bhn9CHB3jiEeNj4uF4,5197
6
- nshutils/logging.py,sha256=tL-6XvdvJEEr7bje9DSmUBpm6pnJS9XG_1fuw3U1eME,2573
7
- nshutils/snoop.py,sha256=2RNlOcBFnCUyOsfGlbBb8FwSGq03hxfypMfqMA0No-A,7356
8
- nshutils/typecheck.py,sha256=_KtfinRy9A0Dgq78kN5MGGrefvb6jn2tGY6svdLEBAs,4915
9
- nshutils-0.7.0.dist-info/METADATA,sha256=ZsJMZNqLTQACnbXgNmIZnfUqaTozC6hLZ5MehiKzv9M,517
10
- nshutils-0.7.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
11
- nshutils-0.7.0.dist-info/RECORD,,