returnn 1.20250423.204935__py3-none-any.whl → 1.20250429.161207__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 CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: returnn
3
- Version: 1.20250423.204935
3
+ Version: 1.20250429.161207
4
4
  Summary: The RWTH extensible training framework for universal recurrent neural networks
5
5
  Home-page: https://github.com/rwth-i6/returnn/
6
6
  Author: Albert Zeyer
@@ -1,2 +1,2 @@
1
- version = '1.20250423.204935'
2
- long_version = '1.20250423.204935+git.47ba7a4'
1
+ version = '1.20250429.161207'
2
+ long_version = '1.20250429.161207+git.d4d26bf'
returnn/datasets/hdf.py CHANGED
@@ -1073,6 +1073,8 @@ class SimpleHDFWriter:
1073
1073
  which can be read later by :class:`HDFDataset`.
1074
1074
 
1075
1075
  Note that we dump to a temp file first, and only at :func:`close` we move it over to the real destination.
1076
+
1077
+ Can be used as a context manager, i.e. with the `with` statement.
1076
1078
  """
1077
1079
 
1078
1080
  def __init__(
@@ -1413,6 +1415,12 @@ class SimpleHDFWriter:
1413
1415
  os.remove(self.tmp_filename)
1414
1416
  self.tmp_filename = None
1415
1417
 
1418
+ def __enter__(self):
1419
+ return self
1420
+
1421
+ def __exit__(self, exc_type, exc_val, exc_tb):
1422
+ self.close()
1423
+
1416
1424
 
1417
1425
  class HDFDatasetWriter:
1418
1426
  """
@@ -28,12 +28,14 @@ def raw_dict_to_extern_data(
28
28
  extern_data_template: TensorDict,
29
29
  device: Union[str, torch.device],
30
30
  float_dtype: Optional[Union[str, torch.dtype]] = None,
31
+ with_eval_targets: bool = False,
31
32
  ) -> TensorDict:
32
33
  """
33
34
  :param extern_data_raw: This comes out of the DataLoader, via our collate_batch.
34
35
  :param extern_data_template: Specified via `extern_data` in the config.
35
36
  :param device: E.g. the GPU.
36
37
  :param float_dtype:
38
+ :param with_eval_targets: if False, we skip all tensors with ``available_for_inference=False``.
37
39
  :return: tensor dict, like extern_data_template, but with raw tensors set to Torch tensors, on the right device.
38
40
  """
39
41
  if isinstance(float_dtype, str):
@@ -47,6 +49,8 @@ def raw_dict_to_extern_data(
47
49
  batch_dim.dyn_size_ext = Tensor(batch_dim.name or "batch", dims=[], dtype="int32")
48
50
  extern_data = TensorDict()
49
51
  for k, data in extern_data_template.data.items():
52
+ if not with_eval_targets and not data.available_for_inference:
53
+ continue
50
54
  data = data.copy_template()
51
55
  raw_tensor = extern_data_raw[k]
52
56
  assert len(raw_tensor.shape) == data.batch_ndim, f"ndim mismatch for {k}: {raw_tensor.shape} vs {data}"
returnn/torch/engine.py CHANGED
@@ -435,6 +435,7 @@ class Engine(EngineBase):
435
435
  extern_data_template=self.extern_data,
436
436
  device=self._device,
437
437
  float_dtype=self._default_float_dtype,
438
+ with_eval_targets=True,
438
439
  )
439
440
  self._run_step(extern_data, train_flag=True, train_func=True)
440
441
 
@@ -660,6 +661,7 @@ class Engine(EngineBase):
660
661
  extern_data_template=self.extern_data,
661
662
  device=self._device,
662
663
  float_dtype=self._default_float_dtype,
664
+ with_eval_targets=True,
663
665
  )
664
666
 
665
667
  self._run_step(extern_data, train_func=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: returnn
3
- Version: 1.20250423.204935
3
+ Version: 1.20250429.161207
4
4
  Summary: The RWTH extensible training framework for universal recurrent neural networks
5
5
  Home-page: https://github.com/rwth-i6/returnn/
6
6
  Author: Albert Zeyer
@@ -1,9 +1,9 @@
1
- returnn/PKG-INFO,sha256=OtXOXLtypwqmbDHAjdMLb8hfxfIchsfWiqoqOLI4wKY,5215
1
+ returnn/PKG-INFO,sha256=HyJ82YwGT_Vw0szcqg-a4TqmDp-OQ2YsRXQ8rM5gTg8,5215
2
2
  returnn/__init__.py,sha256=biBtRsM0WZ406vShaeH-9WFoqJ8XwTbn6g0EeFJ7l8E,1012
3
3
  returnn/__main__.py,sha256=qBFbuB1yN3adgVM5pXt2-Yq9vorjRNchNPL8kDKx44M,31752
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=J-rMLkHg-LEZelYDAeLRsx9V68S-c2xtz1DA_5gE4-I,77
6
+ returnn/_setup_info_generated.py,sha256=DR3lkkJjhQ4JxpXrXSh3Yr0jKAWL6KbWNKJUE9DMJPs,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
@@ -19,7 +19,7 @@ returnn/datasets/cached.py,sha256=DIRdWrxBmsZG8O_9eVxBO5mcdo4f5KU-Xb-4wVz59Io,25
19
19
  returnn/datasets/cached2.py,sha256=_6pza3IG68JexaExhj1ld3fP6pE7T-G804driJ9Z_qo,12141
20
20
  returnn/datasets/distrib_files.py,sha256=wMOP0GX4vwaSwKtcHPEcj_zFKS__xVNNCKze5JkZ930,29881
21
21
  returnn/datasets/generating.py,sha256=E_6KpnSu8ChqG3pb4VTChWDsBTonIwFFAj53SI9NSow,99846
22
- returnn/datasets/hdf.py,sha256=yqzr-nzqlt02QZoW2uFowKT19gd5e-9mJpHCKSQxW8o,67643
22
+ returnn/datasets/hdf.py,sha256=fPlzmZtyblyzurRkqQUWKAWDqwzU6NPdJEqF2OuIEpU,67833
23
23
  returnn/datasets/lm.py,sha256=5hSdBgmgTP0IzO2p-JjiWtny0Zb0M20goXtjlw4JVR4,99206
24
24
  returnn/datasets/map.py,sha256=kOBJVZmwDhLsOplzDNByIfa0NRSUaMo2Lsy36lBvxrM,10907
25
25
  returnn/datasets/meta.py,sha256=EySwPQUqIAzvocAoSpMxszHbymXjJeCSGhDn0T1BO-0,95355
@@ -207,10 +207,10 @@ returnn/tf/util/open_fst.py,sha256=sZRDw4TbxvhGqpGdUJWy1ebvlZm4_RPhygpRw9uLAOQ,1
207
207
  returnn/torch/README.md,sha256=jzJ2FpOHW02vxN69yKaV97C9LI-hmvjBglKfdZXIDdc,85
208
208
  returnn/torch/__init__.py,sha256=MHEUyNHB20Vy89uKAqZoj6FxJKF1Gq3HW-i6ra1pNcI,24
209
209
  returnn/torch/distributed.py,sha256=skFyutdVztxgTEk3HHJ8S83qRWbNpkNT8Tj16Ic0_hE,6981
210
- returnn/torch/engine.py,sha256=yfqP9jzOH1OjiETqoBh20YOeEaX_kyr_kwPUkhSFxiI,77833
210
+ returnn/torch/engine.py,sha256=7vFqhESIR_0icesKyJ04CpaqqaFHUlWy0d64SjZMErE,77925
211
211
  returnn/torch/updater.py,sha256=GqtBvZpElPVMm0lq84JPl4NVLFFETZAzAbR0rTomSao,28249
212
212
  returnn/torch/data/__init__.py,sha256=6cLNEi8KoGI12PF6akN7mI_mtjlx-0hcQAfMYoExwik,132
213
- returnn/torch/data/extern_data.py,sha256=OSoy3x1KiyiJCr7DfF5uPFAu09We2N2WbA0yo-pYXxM,7601
213
+ returnn/torch/data/extern_data.py,sha256=zEoezCRg9JMf53KZJmWpzHspyAS9M8X3jEg4SmHSzko,7830
214
214
  returnn/torch/data/pipeline.py,sha256=mA6R1QU9vvRmfaUBvdqI9jQeIB3O-01ODcpmXs1SZ-w,29458
215
215
  returnn/torch/data/queued_data_iter.py,sha256=PoOsGHdHVZjTmcyfq_ZOw--P6hyfTdmAWIRGq_Z_nLM,888
216
216
  returnn/torch/data/returnn_dataset_wrapper.py,sha256=2CaDapzrlqahANuq-nyVAtv5ENHuM8A7okORwYJDisg,8006
@@ -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.20250423.204935.dist-info/LICENSE,sha256=ywBD_U2aD4vpuoIgNAsjIGBYydl0tVKll3De0Z8s77c,11041
257
- returnn-1.20250423.204935.dist-info/METADATA,sha256=OtXOXLtypwqmbDHAjdMLb8hfxfIchsfWiqoqOLI4wKY,5215
258
- returnn-1.20250423.204935.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
259
- returnn-1.20250423.204935.dist-info/top_level.txt,sha256=Lsn4WZc5Pbfk0-xDQOgnFCxOoqxL4CyeM3N1TFbJncw,8
260
- returnn-1.20250423.204935.dist-info/RECORD,,
256
+ returnn-1.20250429.161207.dist-info/LICENSE,sha256=ywBD_U2aD4vpuoIgNAsjIGBYydl0tVKll3De0Z8s77c,11041
257
+ returnn-1.20250429.161207.dist-info/METADATA,sha256=HyJ82YwGT_Vw0szcqg-a4TqmDp-OQ2YsRXQ8rM5gTg8,5215
258
+ returnn-1.20250429.161207.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
259
+ returnn-1.20250429.161207.dist-info/top_level.txt,sha256=Lsn4WZc5Pbfk0-xDQOgnFCxOoqxL4CyeM3N1TFbJncw,8
260
+ returnn-1.20250429.161207.dist-info/RECORD,,