tensorguard 1.0.1__py3-none-any.whl → 1.0.3__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 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.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/shapeguard"
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
  )
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.1
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
- # Tensor Guard
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
  [![PyPI version fury.io](https://badge.fury.io/py/tensorguard.svg)](https://pypi.python.org/pypi/tensorguard/)
@@ -1,13 +1,13 @@
1
- tensorguard/__init__.py,sha256=T76PYDaRli7RV7RvIcNl44qB4RIWNj8_i4ldqtF2mV8,4601
1
+ tensorguard/__init__.py,sha256=QcWi8YZ4azQHqB_yVgewJpr534LqchSy8YlmF1TWJlg,4760
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=edxSW0HFcQNU40VGVi6HLk6IKqoRb0jFkF_tz-06UrE,2621
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.1.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
10
- tensorguard-1.0.1.dist-info/METADATA,sha256=XjBBgLoh63qpVsdzudt5IA6KPtIBdH97EsGv9pVjZ2U,3392
11
- tensorguard-1.0.1.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
12
- tensorguard-1.0.1.dist-info/top_level.txt,sha256=DEE4LIqisLkVDVQaghKu73KF5sJHQ_zJRikOzSUA1Rs,12
13
- tensorguard-1.0.1.dist-info/RECORD,,
9
+ tensorguard-1.0.3.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
10
+ tensorguard-1.0.3.dist-info/METADATA,sha256=9J7eFwEUCoBEOFh03Gx2IZYy74oUklw2zKsH4nCG9xU,3391
11
+ tensorguard-1.0.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
12
+ tensorguard-1.0.3.dist-info/top_level.txt,sha256=DEE4LIqisLkVDVQaghKu73KF5sJHQ_zJRikOzSUA1Rs,12
13
+ tensorguard-1.0.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5