returnn 1.20250618.161226__py3-none-any.whl → 1.20250620.102515__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 +41 -5
- {returnn-1.20250618.161226.dist-info → returnn-1.20250620.102515.dist-info}/METADATA +1 -1
- {returnn-1.20250618.161226.dist-info → returnn-1.20250620.102515.dist-info}/RECORD +8 -8
- {returnn-1.20250618.161226.dist-info → returnn-1.20250620.102515.dist-info}/LICENSE +0 -0
- {returnn-1.20250618.161226.dist-info → returnn-1.20250620.102515.dist-info}/WHEEL +0 -0
- {returnn-1.20250618.161226.dist-info → returnn-1.20250620.102515.dist-info}/top_level.txt +0 -0
returnn/PKG-INFO
CHANGED
returnn/_setup_info_generated.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
version = '1.
|
|
2
|
-
long_version = '1.
|
|
1
|
+
version = '1.20250620.102515'
|
|
2
|
+
long_version = '1.20250620.102515+git.98f67ee'
|
returnn/util/better_exchook.py
CHANGED
|
@@ -102,6 +102,7 @@ cfg_print_not_found = False
|
|
|
102
102
|
cfg_print_bound_methods = False
|
|
103
103
|
cfg_print_modules = False
|
|
104
104
|
cfg_print_module_functions = False
|
|
105
|
+
cfg_print_module_classes = False
|
|
105
106
|
|
|
106
107
|
|
|
107
108
|
def parse_py_statement(line):
|
|
@@ -1058,7 +1059,12 @@ class _OutputLinesCollector:
|
|
|
1058
1059
|
:param typing.Any obj:
|
|
1059
1060
|
:rtype: str
|
|
1060
1061
|
"""
|
|
1061
|
-
|
|
1062
|
+
if isinstance(obj, types.FunctionType) and hasattr(obj, "__module__") and hasattr(obj, "__qualname__"):
|
|
1063
|
+
s = "<function %s.%s>" % (obj.__module__, obj.__qualname__)
|
|
1064
|
+
elif isinstance(obj, type) and hasattr(obj, "__module__") and hasattr(obj, "__qualname__"):
|
|
1065
|
+
s = "<class %s.%s>" % (obj.__module__, obj.__qualname__)
|
|
1066
|
+
else:
|
|
1067
|
+
s = repr(obj)
|
|
1062
1068
|
limit = output_limit()
|
|
1063
1069
|
if len(s) > limit:
|
|
1064
1070
|
if self.dom_term:
|
|
@@ -1089,18 +1095,24 @@ def format_tb(
|
|
|
1089
1095
|
clear_frames=True,
|
|
1090
1096
|
):
|
|
1091
1097
|
"""
|
|
1092
|
-
|
|
1098
|
+
Formats a traceback into a list of strings, each corresponding to one frame.
|
|
1099
|
+
|
|
1100
|
+
Replacement for traceback.format_tb.
|
|
1101
|
+
|
|
1102
|
+
:param types.TracebackType|types.FrameType|StackSummary tb: traceback. If None, will use sys._getframe
|
|
1093
1103
|
:param int|None limit: limit the traceback to this number of frames. by default, will look at sys.tracebacklimit
|
|
1094
1104
|
:param dict[str,typing.Any]|None allLocals: if set, will update it with all locals from all frames
|
|
1095
1105
|
:param dict[str,typing.Any]|None allGlobals: if set, will update it with all globals from all frames
|
|
1096
1106
|
:param bool withTitle:
|
|
1097
1107
|
:param bool|None with_color: output with ANSI escape codes for color
|
|
1098
|
-
:param bool with_vars: will print var
|
|
1108
|
+
:param bool with_vars: will print var contents that are referenced in the source code line. by default enabled.
|
|
1099
1109
|
:param bool clear_frames: whether to call frame.clear() after processing it.
|
|
1100
1110
|
That will potentially fix some mem leaks regarding locals, so it can be important.
|
|
1101
1111
|
Also see https://github.com/python/cpython/issues/113939.
|
|
1102
|
-
However, any further access to frame locals will not work (e.g
|
|
1103
|
-
:return: list of strings
|
|
1112
|
+
However, any further access to frame locals will not work (e.g., if you want to use a debugger afterward).
|
|
1113
|
+
:return: list of strings, each corresponding to one frame in the traceback.
|
|
1114
|
+
Each string contains the file name, line number, function name, source code line, maybe relevant variables,
|
|
1115
|
+
etc., and a final newline.
|
|
1104
1116
|
:rtype: list[str]
|
|
1105
1117
|
"""
|
|
1106
1118
|
color = Color(enable=with_color)
|
|
@@ -1242,6 +1254,12 @@ def format_tb(
|
|
|
1242
1254
|
and _is_module_function(token_base_dict, token[0], obj_is_dict=True)
|
|
1243
1255
|
):
|
|
1244
1256
|
continue
|
|
1257
|
+
if (
|
|
1258
|
+
not cfg_print_module_classes
|
|
1259
|
+
and len(token) == 1
|
|
1260
|
+
and _is_module_class(token_base_dict, token[0], obj_is_dict=True)
|
|
1261
|
+
):
|
|
1262
|
+
continue
|
|
1245
1263
|
elif token[0] in f.f_builtins:
|
|
1246
1264
|
if not cfg_print_builtins:
|
|
1247
1265
|
continue
|
|
@@ -1283,6 +1301,12 @@ def format_tb(
|
|
|
1283
1301
|
and _is_module_function(token_parent_obj, token[-1])
|
|
1284
1302
|
):
|
|
1285
1303
|
continue
|
|
1304
|
+
if (
|
|
1305
|
+
not cfg_print_module_classes
|
|
1306
|
+
and token_parent_obj is not None
|
|
1307
|
+
and _is_module_class(token_parent_obj, token[-1])
|
|
1308
|
+
):
|
|
1309
|
+
continue
|
|
1286
1310
|
token_repr = add_indent_lines(token_prefix_str, format_py_obj(token_obj))
|
|
1287
1311
|
|
|
1288
1312
|
output(prefix, token_repr)
|
|
@@ -1333,6 +1357,8 @@ def format_tb(
|
|
|
1333
1357
|
|
|
1334
1358
|
def print_tb(tb, file=None, **kwargs):
|
|
1335
1359
|
"""
|
|
1360
|
+
Prints the traceback to stderr, or the given file.
|
|
1361
|
+
|
|
1336
1362
|
Replacement for traceback.print_tb.
|
|
1337
1363
|
|
|
1338
1364
|
:param types.TracebackType|types.FrameType|StackSummary tb:
|
|
@@ -1866,6 +1892,16 @@ def _is_module_function(obj, attr_name, obj_is_dict=False):
|
|
|
1866
1892
|
return isinstance(func, types.FunctionType)
|
|
1867
1893
|
|
|
1868
1894
|
|
|
1895
|
+
def _is_module_class(obj, attr_name, obj_is_dict=False):
|
|
1896
|
+
if obj_is_dict:
|
|
1897
|
+
cls = obj.get(attr_name, None)
|
|
1898
|
+
else:
|
|
1899
|
+
if not isinstance(obj, types.ModuleType):
|
|
1900
|
+
return False
|
|
1901
|
+
cls = getattr(obj, attr_name, None)
|
|
1902
|
+
return isinstance(cls, type)
|
|
1903
|
+
|
|
1904
|
+
|
|
1869
1905
|
def install():
|
|
1870
1906
|
"""
|
|
1871
1907
|
Replaces sys.excepthook by our better_exchook.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
returnn/PKG-INFO,sha256=
|
|
1
|
+
returnn/PKG-INFO,sha256=SukecFA543t3-WlWN1ENSGlUCNa735c92GHdnePY8xg,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=uxrxbQLCrAPLaZOlKmpyxV4GhL1oM1RdNC4IrcYNdJw,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=39yvRecluDgYhViwSkaQ8crJ_cBWI63KeEGuK4RKe5w,70843
|
|
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.
|
|
257
|
-
returnn-1.
|
|
258
|
-
returnn-1.
|
|
259
|
-
returnn-1.
|
|
260
|
-
returnn-1.
|
|
256
|
+
returnn-1.20250620.102515.dist-info/LICENSE,sha256=ywBD_U2aD4vpuoIgNAsjIGBYydl0tVKll3De0Z8s77c,11041
|
|
257
|
+
returnn-1.20250620.102515.dist-info/METADATA,sha256=SukecFA543t3-WlWN1ENSGlUCNa735c92GHdnePY8xg,5215
|
|
258
|
+
returnn-1.20250620.102515.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
259
|
+
returnn-1.20250620.102515.dist-info/top_level.txt,sha256=Lsn4WZc5Pbfk0-xDQOgnFCxOoqxL4CyeM3N1TFbJncw,8
|
|
260
|
+
returnn-1.20250620.102515.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|