tensorguard 1.0.1__py3-none-any.whl → 1.0.2__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.
- tensorguard/__init__.py +11 -3
- tensorguard/guard.py +8 -0
- {tensorguard-1.0.1.dist-info → tensorguard-1.0.2.dist-info}/METADATA +2 -2
- {tensorguard-1.0.1.dist-info → tensorguard-1.0.2.dist-info}/RECORD +7 -7
- {tensorguard-1.0.1.dist-info → tensorguard-1.0.2.dist-info}/WHEEL +1 -1
- {tensorguard-1.0.1.dist-info → tensorguard-1.0.2.dist-info}/licenses/LICENSE +0 -0
- {tensorguard-1.0.1.dist-info → tensorguard-1.0.2.dist-info}/top_level.txt +0 -0
tensorguard/__init__.py
CHANGED
|
@@ -18,12 +18,12 @@ from tensorguard import tools
|
|
|
18
18
|
from tensorguard.exception import ShapeError
|
|
19
19
|
from tensorguard.guard import TensorGuard
|
|
20
20
|
|
|
21
|
-
__version__ = "1.0.
|
|
21
|
+
__version__ = "1.0.2"
|
|
22
22
|
|
|
23
23
|
__author__ = "Michele De Vita"
|
|
24
24
|
__author_email__ = "mik3dev@gmail.com"
|
|
25
25
|
|
|
26
|
-
__url__ = "https://github.com/Michedev/
|
|
26
|
+
__url__ = "https://github.com/Michedev/tensorguard"
|
|
27
27
|
|
|
28
28
|
from tensorguard.tools import ShapedTensor
|
|
29
29
|
|
|
@@ -168,6 +168,13 @@ def safe_del_dim(key: str):
|
|
|
168
168
|
del_dim(key)
|
|
169
169
|
|
|
170
170
|
|
|
171
|
+
def clear_dims():
|
|
172
|
+
"""
|
|
173
|
+
Remove all the shape tokens
|
|
174
|
+
"""
|
|
175
|
+
for k in __tg.dims:
|
|
176
|
+
del_dim(k)
|
|
177
|
+
|
|
171
178
|
__all__ = (
|
|
172
179
|
"TensorGuard",
|
|
173
180
|
"__version__",
|
|
@@ -185,5 +192,6 @@ __all__ = (
|
|
|
185
192
|
"has_dim",
|
|
186
193
|
"del_dim",
|
|
187
194
|
"safe_del_dim",
|
|
188
|
-
"get_dims"
|
|
195
|
+
"get_dims",
|
|
196
|
+
"clear_dims",
|
|
189
197
|
)
|
tensorguard/guard.py
CHANGED
|
@@ -38,6 +38,14 @@ class TensorGuard:
|
|
|
38
38
|
local_dims.update(kwargs)
|
|
39
39
|
return tools.evaluate(template, local_dims)
|
|
40
40
|
|
|
41
|
+
|
|
42
|
+
def clear_dims(self):
|
|
43
|
+
"""
|
|
44
|
+
Remove all the shape tokens
|
|
45
|
+
"""
|
|
46
|
+
for k in self.dims:
|
|
47
|
+
del self[k]
|
|
48
|
+
|
|
41
49
|
def __getitem__(self, item: str) -> List[Optional[int]]:
|
|
42
50
|
return tools.evaluate(item, self.dims)
|
|
43
51
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensorguard
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: TensorGuard helps to guard against bad Tensor Shapes
|
|
5
5
|
Home-page: https://github.com/Michedev/tensorguard
|
|
6
6
|
Author: mikedev
|
|
@@ -37,7 +37,7 @@ Dynamic: requires-dist
|
|
|
37
37
|
Dynamic: requires-python
|
|
38
38
|
Dynamic: summary
|
|
39
39
|
|
|
40
|
-
#
|
|
40
|
+
# TensorGuard
|
|
41
41
|
<img src="https://github.com/user-attachments/assets/dfddbe05-87e5-48df-8608-e25bf6087044" alt="tensorguard logo" width="300">
|
|
42
42
|
|
|
43
43
|
[](https://pypi.python.org/pypi/tensorguard/)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
tensorguard/__init__.py,sha256=
|
|
1
|
+
tensorguard/__init__.py,sha256=JxbfvSj7fskkELMWr1PALCj16u8fz_t3S0b4NNHtPCg,4731
|
|
2
2
|
tensorguard/dim_specs.py,sha256=HcI-3qwmvlhLPhJYXjWEoL8_JrTmoSpfGbfiOLJBtsk,10555
|
|
3
3
|
tensorguard/exception.py,sha256=aHBreiNcBJxc_U07uX94W6AvilTofbldTJgOTrubvIQ,792
|
|
4
|
-
tensorguard/guard.py,sha256=
|
|
4
|
+
tensorguard/guard.py,sha256=a2R9EODmQlJv0jl9Rltg2YPH-NTdIVSE2qtab9UhGYo,2761
|
|
5
5
|
tensorguard/parser.py,sha256=rAGlPM27edH8z9W7SzhyVkkKw6ieZZTYCnZIA1O0H-Q,1389
|
|
6
6
|
tensorguard/shape_spec.py,sha256=DqyZ8A1MIMCksRZJvpbmgKAR6Y1Fsr9SE77oeyIE2ZI,3759
|
|
7
7
|
tensorguard/shape_spec_parser.py,sha256=jgR4mDsGfrSkAepIbOcpde9JQk6lH6oFoNJJ3ClROB4,76592
|
|
8
8
|
tensorguard/tools.py,sha256=9e0AFpmu7fsUdykqzA-A7HoAr5VQENYNmrGawolWo5A,3065
|
|
9
|
-
tensorguard-1.0.
|
|
10
|
-
tensorguard-1.0.
|
|
11
|
-
tensorguard-1.0.
|
|
12
|
-
tensorguard-1.0.
|
|
13
|
-
tensorguard-1.0.
|
|
9
|
+
tensorguard-1.0.2.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
10
|
+
tensorguard-1.0.2.dist-info/METADATA,sha256=KTU-7A290Il2dJOGsOIxOQ_8p6yfKL2c0e4oXuEjwn4,3391
|
|
11
|
+
tensorguard-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
tensorguard-1.0.2.dist-info/top_level.txt,sha256=DEE4LIqisLkVDVQaghKu73KF5sJHQ_zJRikOzSUA1Rs,12
|
|
13
|
+
tensorguard-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|