tensorguard 1.0.1__tar.gz → 1.0.3__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.
- {tensorguard-1.0.1/tensorguard.egg-info → tensorguard-1.0.3}/PKG-INFO +2 -2
- {tensorguard-1.0.1 → tensorguard-1.0.3}/README.md +1 -1
- {tensorguard-1.0.1 → tensorguard-1.0.3}/setup.py +1 -1
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/__init__.py +12 -3
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/guard.py +8 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3/tensorguard.egg-info}/PKG-INFO +2 -2
- {tensorguard-1.0.1 → tensorguard-1.0.3}/LICENSE +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/MANIFEST.in +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/requirements.txt +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/setup.cfg +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/dim_specs.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/exception.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/parser.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/shape_spec.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/shape_spec_parser.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard/tools.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard.egg-info/SOURCES.txt +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard.egg-info/dependency_links.txt +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard.egg-info/requires.txt +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tensorguard.egg-info/top_level.txt +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/test-requirements.txt +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tests/test_global_accessors.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tests/test_guard.py +0 -0
- {tensorguard-1.0.1 → tensorguard-1.0.3}/tests/test_match.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensorguard
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
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,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TensorGuard
|
|
2
2
|
<img src="https://github.com/user-attachments/assets/dfddbe05-87e5-48df-8608-e25bf6087044" alt="tensorguard logo" width="300">
|
|
3
3
|
|
|
4
4
|
[](https://pypi.python.org/pypi/tensorguard/)
|
|
@@ -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.3"
|
|
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,14 @@ 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
|
+
keys = list(__tg.dims.keys())
|
|
176
|
+
for k in keys:
|
|
177
|
+
del_dim(k)
|
|
178
|
+
|
|
171
179
|
__all__ = (
|
|
172
180
|
"TensorGuard",
|
|
173
181
|
"__version__",
|
|
@@ -185,5 +193,6 @@ __all__ = (
|
|
|
185
193
|
"has_dim",
|
|
186
194
|
"del_dim",
|
|
187
195
|
"safe_del_dim",
|
|
188
|
-
"get_dims"
|
|
196
|
+
"get_dims",
|
|
197
|
+
"clear_dims",
|
|
189
198
|
)
|
|
@@ -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.3
|
|
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/)
|
|
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
|