returnn 1.20250618.1520__py3-none-any.whl → 1.20250618.161226__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.
Potentially problematic release.
This version of returnn might be problematic. Click here for more details.
- returnn/PKG-INFO +1 -1
- returnn/_setup_info_generated.py +2 -2
- returnn/util/better_exchook.py +94 -64
- {returnn-1.20250618.1520.dist-info → returnn-1.20250618.161226.dist-info}/METADATA +1 -1
- {returnn-1.20250618.1520.dist-info → returnn-1.20250618.161226.dist-info}/RECORD +8 -8
- {returnn-1.20250618.1520.dist-info → returnn-1.20250618.161226.dist-info}/LICENSE +0 -0
- {returnn-1.20250618.1520.dist-info → returnn-1.20250618.161226.dist-info}/WHEEL +0 -0
- {returnn-1.20250618.1520.dist-info → returnn-1.20250618.161226.dist-info}/top_level.txt +0 -0
returnn/PKG-INFO
CHANGED
returnn/_setup_info_generated.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
version = '1.20250618.
|
|
2
|
-
long_version = '1.20250618.
|
|
1
|
+
version = '1.20250618.161226'
|
|
2
|
+
long_version = '1.20250618.161226+git.a2170b5'
|
returnn/util/better_exchook.py
CHANGED
|
@@ -58,6 +58,7 @@ import threading
|
|
|
58
58
|
import keyword
|
|
59
59
|
import inspect
|
|
60
60
|
import contextlib
|
|
61
|
+
import types
|
|
61
62
|
from weakref import WeakKeyDictionary
|
|
62
63
|
|
|
63
64
|
try:
|
|
@@ -98,6 +99,9 @@ PY3 = sys.version_info[0] >= 3
|
|
|
98
99
|
|
|
99
100
|
cfg_print_builtins = False
|
|
100
101
|
cfg_print_not_found = False
|
|
102
|
+
cfg_print_bound_methods = False
|
|
103
|
+
cfg_print_modules = False
|
|
104
|
+
cfg_print_module_functions = False
|
|
101
105
|
|
|
102
106
|
|
|
103
107
|
def parse_py_statement(line):
|
|
@@ -1166,41 +1170,6 @@ def format_tb(
|
|
|
1166
1170
|
n = 0
|
|
1167
1171
|
_tb = tb
|
|
1168
1172
|
|
|
1169
|
-
class NotFound(Exception):
|
|
1170
|
-
"""
|
|
1171
|
-
Identifier not found.
|
|
1172
|
-
"""
|
|
1173
|
-
|
|
1174
|
-
def _resolve_identifier(namespace, keys):
|
|
1175
|
-
"""
|
|
1176
|
-
:param dict[str,typing.Any] namespace:
|
|
1177
|
-
:param typing.Sequence[str] keys:
|
|
1178
|
-
:return: namespace[name[0]][name[1]]...
|
|
1179
|
-
"""
|
|
1180
|
-
if keys[0] not in namespace:
|
|
1181
|
-
raise NotFound()
|
|
1182
|
-
obj = namespace[keys[0]]
|
|
1183
|
-
for part in keys[1:]:
|
|
1184
|
-
obj = getattr(obj, part)
|
|
1185
|
-
return obj
|
|
1186
|
-
|
|
1187
|
-
# noinspection PyShadowingNames
|
|
1188
|
-
def _try_set(old, prefix, func):
|
|
1189
|
-
"""
|
|
1190
|
-
:param None|str old:
|
|
1191
|
-
:param str prefix:
|
|
1192
|
-
:param func:
|
|
1193
|
-
:return: old
|
|
1194
|
-
"""
|
|
1195
|
-
if old is not None:
|
|
1196
|
-
return old
|
|
1197
|
-
try:
|
|
1198
|
-
return add_indent_lines(prefix, func())
|
|
1199
|
-
except NotFound:
|
|
1200
|
-
return old
|
|
1201
|
-
except Exception as e:
|
|
1202
|
-
return prefix + "!" + e.__class__.__name__ + ": " + str(e)
|
|
1203
|
-
|
|
1204
1173
|
while _tb is not None and (limit is None or n < limit):
|
|
1205
1174
|
if isframe(_tb):
|
|
1206
1175
|
f = _tb
|
|
@@ -1260,38 +1229,65 @@ def format_tb(
|
|
|
1260
1229
|
for token in [splitted_token[0:i] for i in range(1, len(splitted_token) + 1)]:
|
|
1261
1230
|
if token in already_covered_locals:
|
|
1262
1231
|
continue
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
color("<local> ", color.fg_colors[0])
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
continue
|
|
1288
|
-
token_value = token_value or color("<not found>", color.fg_colors[0])
|
|
1232
|
+
already_covered_locals.add(token)
|
|
1233
|
+
if token[0] in f.f_locals:
|
|
1234
|
+
token_base_dict = f.f_locals
|
|
1235
|
+
token_prefix_str = color("<local> ", color.fg_colors[0])
|
|
1236
|
+
elif token[0] in f.f_globals:
|
|
1237
|
+
token_base_dict = f.f_globals
|
|
1238
|
+
token_prefix_str = color("<global> ", color.fg_colors[0])
|
|
1239
|
+
if (
|
|
1240
|
+
not cfg_print_module_functions
|
|
1241
|
+
and len(token) == 1
|
|
1242
|
+
and _is_module_function(token_base_dict, token[0], obj_is_dict=True)
|
|
1243
|
+
):
|
|
1244
|
+
continue
|
|
1245
|
+
elif token[0] in f.f_builtins:
|
|
1246
|
+
if not cfg_print_builtins:
|
|
1247
|
+
continue
|
|
1248
|
+
token_base_dict = f.f_builtins
|
|
1249
|
+
token_prefix_str = color("<builtin> ", color.fg_colors[0])
|
|
1250
|
+
else:
|
|
1251
|
+
if not cfg_print_not_found:
|
|
1252
|
+
continue
|
|
1253
|
+
token_base_dict = None
|
|
1254
|
+
token_prefix_str = None
|
|
1255
|
+
|
|
1289
1256
|
prefix = " %s " % color(".", color.fg_colors[0], bold=True).join(
|
|
1290
1257
|
token
|
|
1291
1258
|
) + color("= ", color.fg_colors[0], bold=True)
|
|
1292
|
-
|
|
1293
|
-
|
|
1259
|
+
|
|
1260
|
+
if token_prefix_str is None: # not found
|
|
1261
|
+
token_repr = color("<not found>", color.fg_colors[0])
|
|
1262
|
+
else:
|
|
1263
|
+
try:
|
|
1264
|
+
token_parent_obj = None
|
|
1265
|
+
token_obj = token_base_dict[token[0]]
|
|
1266
|
+
for attr in token[1:]:
|
|
1267
|
+
token_parent_obj = token_obj
|
|
1268
|
+
token_obj = getattr(token_obj, attr)
|
|
1269
|
+
except Exception as e:
|
|
1270
|
+
token_repr = token_prefix_str + "!" + e.__class__.__name__ + ": " + str(e)
|
|
1271
|
+
else: # found
|
|
1272
|
+
if (
|
|
1273
|
+
not cfg_print_bound_methods
|
|
1274
|
+
and token_parent_obj is not None
|
|
1275
|
+
and _is_bound_method(token_parent_obj, token[-1])
|
|
1276
|
+
):
|
|
1277
|
+
continue
|
|
1278
|
+
if not cfg_print_modules and isinstance(token_obj, types.ModuleType):
|
|
1279
|
+
continue
|
|
1280
|
+
if (
|
|
1281
|
+
not cfg_print_module_functions
|
|
1282
|
+
and token_parent_obj is not None
|
|
1283
|
+
and _is_module_function(token_parent_obj, token[-1])
|
|
1284
|
+
):
|
|
1285
|
+
continue
|
|
1286
|
+
token_repr = add_indent_lines(token_prefix_str, format_py_obj(token_obj))
|
|
1287
|
+
|
|
1288
|
+
output(prefix, token_repr)
|
|
1294
1289
|
num_printed_locals += 1
|
|
1290
|
+
|
|
1295
1291
|
if num_printed_locals == 0:
|
|
1296
1292
|
if output.lines and output.lines[-1].endswith(locals_start_str + "\n"):
|
|
1297
1293
|
output.lines[-1] = output.lines[-1][: -len(locals_start_str) - 1]
|
|
@@ -1299,7 +1295,8 @@ def format_tb(
|
|
|
1299
1295
|
output.lines[-1] = output.lines[-1][:-1] + color(" none", color.fg_colors[0]) + "\n"
|
|
1300
1296
|
else:
|
|
1301
1297
|
output(color(" no locals", color.fg_colors[0]))
|
|
1302
|
-
|
|
1298
|
+
|
|
1299
|
+
else: # no source code available
|
|
1303
1300
|
output(color(" -- code not available --", color.fg_colors[0]))
|
|
1304
1301
|
|
|
1305
1302
|
if clear_frames:
|
|
@@ -1836,6 +1833,39 @@ def _StackSummary_extract(frame_gen, limit=None, lookup_lines=True, capture_loca
|
|
|
1836
1833
|
return result
|
|
1837
1834
|
|
|
1838
1835
|
|
|
1836
|
+
def _is_bound_method(obj, attr_name):
|
|
1837
|
+
if not PY3:
|
|
1838
|
+
return False # not properly supported in Python 2
|
|
1839
|
+
|
|
1840
|
+
meth = getattr(obj, attr_name, None)
|
|
1841
|
+
meth = inspect.unwrap(meth)
|
|
1842
|
+
|
|
1843
|
+
if isinstance(meth, types.MethodType):
|
|
1844
|
+
if meth.__self__ is not obj:
|
|
1845
|
+
return False
|
|
1846
|
+
cls = type(obj)
|
|
1847
|
+
func = getattr(cls, attr_name, None)
|
|
1848
|
+
return meth.__func__ is func
|
|
1849
|
+
|
|
1850
|
+
elif isinstance(meth, (types.BuiltinMethodType, getattr(types, "MethodWrapperType", types.BuiltinMethodType))):
|
|
1851
|
+
if meth.__self__ is not obj:
|
|
1852
|
+
return False
|
|
1853
|
+
return meth.__name__ == attr_name
|
|
1854
|
+
|
|
1855
|
+
else:
|
|
1856
|
+
return False
|
|
1857
|
+
|
|
1858
|
+
|
|
1859
|
+
def _is_module_function(obj, attr_name, obj_is_dict=False):
|
|
1860
|
+
if obj_is_dict:
|
|
1861
|
+
func = obj.get(attr_name, None)
|
|
1862
|
+
else:
|
|
1863
|
+
if not isinstance(obj, types.ModuleType):
|
|
1864
|
+
return False
|
|
1865
|
+
func = getattr(obj, attr_name, None)
|
|
1866
|
+
return isinstance(func, types.FunctionType)
|
|
1867
|
+
|
|
1868
|
+
|
|
1839
1869
|
def install():
|
|
1840
1870
|
"""
|
|
1841
1871
|
Replaces sys.excepthook by our better_exchook.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
returnn/PKG-INFO,sha256=
|
|
1
|
+
returnn/PKG-INFO,sha256=ek1l6FDeyEYBufWdoSAuEVH8uNi3V-WN7aUwbmNdKu8,5215
|
|
2
2
|
returnn/__init__.py,sha256=biBtRsM0WZ406vShaeH-9WFoqJ8XwTbn6g0EeFJ7l8E,1012
|
|
3
3
|
returnn/__main__.py,sha256=lHyZcu_0yc9f7Vf_Kfdy9PmeU0T76XVXnpalHi5WKro,31740
|
|
4
4
|
returnn/__old_mod_loader__.py,sha256=nvsNY-xELdS_IPNkv66Q9Rmvg4dbGW0-EBRDcCmctos,7654
|
|
5
5
|
returnn/__setup__.py,sha256=22kQn2fh11iPM0hLb2Fy5sLmoU1JGvmDxXRYuRgQkwU,4659
|
|
6
|
-
returnn/_setup_info_generated.py,sha256=
|
|
6
|
+
returnn/_setup_info_generated.py,sha256=XBGFZV-ZRw2F4mTMp3fI6LTpxLACFzTkIS0hMgWMgZc,77
|
|
7
7
|
returnn/config.py,sha256=3tmKhB6FnQZaNdtcYsiB61JnEY--iZ2qmJ4yq0b6tE0,29140
|
|
8
8
|
returnn/forward_iface.py,sha256=A_OJiaXsX4MlXQRzST86ylyxSUZbC402PQL1REcqHjM,911
|
|
9
9
|
returnn/learning_rate_control.py,sha256=ZvWryAn_tv9DhV8sh1LV3eE34Yltl3On3mYZAG4hR9s,34684
|
|
@@ -234,7 +234,7 @@ returnn/torch/util/module.py,sha256=MXHIrF9Isu575DDJIa81212ULKwdqu1oOLxDVZecVSk,
|
|
|
234
234
|
returnn/torch/util/scaled_gradient.py,sha256=C5e79mpqtxdtw08OTSy413TSBSlOertRisc-ioiFIaU,3191
|
|
235
235
|
returnn/util/__init__.py,sha256=UIG1qw4idqhW71BV60ha7h9PktxvEVcBIu0lYRossK8,336
|
|
236
236
|
returnn/util/basic.py,sha256=Ep67bFPbxiaMKgsjrUqF0seoswghAqLsUQYcpgQGeyE,142570
|
|
237
|
-
returnn/util/better_exchook.py,sha256=
|
|
237
|
+
returnn/util/better_exchook.py,sha256=7Xk232KYeG7EgtKTajHtB0rAiUrP18uSqr3AFhcQV9A,68993
|
|
238
238
|
returnn/util/bpe.py,sha256=LWFhICZsEOnMwNws0lybPNzKRX6rSr8yKCvP65vjl9Y,19656
|
|
239
239
|
returnn/util/debug.py,sha256=wuRzdg9zB84WWCGyTjmRR_zYypu8gXxlc0nZ6si9OC8,28224
|
|
240
240
|
returnn/util/debug_helpers.py,sha256=0EINLK4uLtoSt5_kHs1M2NIFpMd0S7i4c4rx90U4fJk,2914
|
|
@@ -253,8 +253,8 @@ returnn/util/sig_proc.py,sha256=Tjz0VOAVyqu2qDCF5HZ1JjALjcFsHcNkcd96WgZeKfE,7265
|
|
|
253
253
|
returnn/util/task_system.py,sha256=y4sMVXQ25Qd2z0rx03uOlXlkE-jbCYC1Sjfn-XlraVU,26003
|
|
254
254
|
returnn/util/train_proc_manager.py,sha256=Pjht28k6uz6BNQ47uW6Gf880iyq5q4wx7P_K2tmoAM8,3266
|
|
255
255
|
returnn/util/watch_memory.py,sha256=BR5P2kvBN6UI81cE0_1WAA6Hd1SByLbBaiDxvLhPOew,4213
|
|
256
|
-
returnn-1.20250618.
|
|
257
|
-
returnn-1.20250618.
|
|
258
|
-
returnn-1.20250618.
|
|
259
|
-
returnn-1.20250618.
|
|
260
|
-
returnn-1.20250618.
|
|
256
|
+
returnn-1.20250618.161226.dist-info/LICENSE,sha256=ywBD_U2aD4vpuoIgNAsjIGBYydl0tVKll3De0Z8s77c,11041
|
|
257
|
+
returnn-1.20250618.161226.dist-info/METADATA,sha256=ek1l6FDeyEYBufWdoSAuEVH8uNi3V-WN7aUwbmNdKu8,5215
|
|
258
|
+
returnn-1.20250618.161226.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
259
|
+
returnn-1.20250618.161226.dist-info/top_level.txt,sha256=Lsn4WZc5Pbfk0-xDQOgnFCxOoqxL4CyeM3N1TFbJncw,8
|
|
260
|
+
returnn-1.20250618.161226.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|