returnn 1.20240327.165809__tar.gz → 1.20240522.175941__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.

Potentially problematic release.


This version of returnn might be problematic. Click here for more details.

Files changed (443) hide show
  1. {returnn-1.20240327.165809/returnn.egg-info → returnn-1.20240522.175941}/PKG-INFO +1 -1
  2. returnn-1.20240522.175941/_setup_info_generated.py +2 -0
  3. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/audio.py +5 -2
  4. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/sprint.py +8 -14
  5. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/util/vocabulary.py +50 -54
  6. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_backend.py +2 -0
  7. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/array_.py +57 -2
  8. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/_backend.py +2 -0
  9. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/layers/basic.py +110 -20
  10. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/distributed.py +21 -1
  11. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/engine.py +9 -0
  12. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/frontend/_backend.py +22 -0
  13. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/basic.py +40 -9
  14. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/multi_proc_non_daemonic_spawn.py +43 -9
  15. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/task_system.py +0 -9
  16. {returnn-1.20240327.165809 → returnn-1.20240522.175941/returnn.egg-info}/PKG-INFO +1 -1
  17. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TFEngine.py +29 -23
  18. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TFNetworkLayer.py +21 -2
  19. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TaskSystem.py +28 -0
  20. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_Util.py +60 -0
  21. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_array.py +44 -1
  22. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/dump-dataset.py +2 -0
  23. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/torch_export_to_onnx.py +23 -6
  24. returnn-1.20240327.165809/_setup_info_generated.py +0 -2
  25. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/.editorconfig +0 -0
  26. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/.gitignore +0 -0
  27. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/.gitmodules +0 -0
  28. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/.kateconfig +0 -0
  29. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/CHANGELOG.md +0 -0
  30. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/CODEOWNERS +0 -0
  31. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/CONTRIBUTING.md +0 -0
  32. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/LICENSE +0 -0
  33. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/MANIFEST.in +0 -0
  34. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/README.rst +0 -0
  35. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/__init__.py +0 -0
  36. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/12AX.cluster_map +0 -0
  37. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/_setup_returnn_env.py +0 -0
  38. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-fwd.config +0 -0
  39. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-horovod-mpi.py +0 -0
  40. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-horovod-mpi.py.sh +0 -0
  41. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-horovod-mpi.sh +0 -0
  42. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-hyper-param-tuning.config +0 -0
  43. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-iter-dataset.py +0 -0
  44. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-list-devices.py +0 -0
  45. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-lua-torch-layer.config +0 -0
  46. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-pretrain.config +0 -0
  47. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-record-and-push-to-webserver.py +0 -0
  48. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-returnn-as-framework.py +0 -0
  49. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-rf-pt-benchmark.py +0 -0
  50. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-rf.config +0 -0
  51. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-rhn-enwik8.config +0 -0
  52. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-sprint-interface.py +0 -0
  53. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-att-copy.config +0 -0
  54. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-attention.config +0 -0
  55. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-chunking-blstm.12ax.config +0 -0
  56. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-contribrnn-lstm.12ax.config +0 -0
  57. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-enc-dec.config +0 -0
  58. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-hard-att-copy.config +0 -0
  59. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-lstm-benchmark.py +0 -0
  60. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-maxgradnorm-lstm.12ax.config +0 -0
  61. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-native-lstm-lowmem.12ax.config +0 -0
  62. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-native-lstm.12ax.config +0 -0
  63. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-native-lstm2.12ax.config +0 -0
  64. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-native-lstm2.12ax.tuned.config +0 -0
  65. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-neural-transducer.12ax.config +0 -0
  66. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-rec-explicit-lstm.config +0 -0
  67. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-rec-explicit-rnn.config +0 -0
  68. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-rec-self-att.config +0 -0
  69. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-search-compiled-graph.py +0 -0
  70. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-tf-vanilla-lstm.12ax.config +0 -0
  71. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-timit-lstm-ctc.config +0 -0
  72. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-torch.config +0 -0
  73. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo-upd-mult-model.lstm.12ax.config +0 -0
  74. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/demo.sh +0 -0
  75. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/IAM_lines/a01-000u-00.png +0 -0
  76. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/IAM_lines/a01-007-04.png +0 -0
  77. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/IAM_lines/a01-007-06.png +0 -0
  78. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/README.txt +0 -0
  79. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/chars.txt +0 -0
  80. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/config_demo +0 -0
  81. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/config_fwd +0 -0
  82. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/config_real +0 -0
  83. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/create_IAM_dataset.py +0 -0
  84. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/decode.py +0 -0
  85. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/features/raw/demo.h5 +0 -0
  86. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/go.sh +0 -0
  87. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/lines.txt +0 -0
  88. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/split/eval.txt +0 -0
  89. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/split/train.txt +0 -0
  90. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/IAM/split/valid.txt +0 -0
  91. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/README.md +0 -0
  92. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial/create_test_h5.py +0 -0
  93. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial/forwardconfig +0 -0
  94. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial/go.sh +0 -0
  95. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial/trainconfig +0 -0
  96. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial_rgb/create_test_h5.py +0 -0
  97. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial_rgb/forwardconfig +0 -0
  98. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial_rgb/go.sh +0 -0
  99. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/demos/mdlstm/artificial_rgb/trainconfig +0 -0
  100. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/pyproject.toml +0 -0
  101. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/requirements.txt +0 -0
  102. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/__init__.py +0 -0
  103. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/__main__.py +0 -0
  104. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/__old_mod_loader__.py +0 -0
  105. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/__setup__.py +0 -0
  106. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/config.py +0 -0
  107. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/__init__.py +0 -0
  108. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/basic.py +0 -0
  109. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/bundle_file.py +0 -0
  110. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/cached.py +0 -0
  111. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/cached2.py +0 -0
  112. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/generating.py +0 -0
  113. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/hdf.py +0 -0
  114. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/lm.py +0 -0
  115. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/map.py +0 -0
  116. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/meta.py +0 -0
  117. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/multi_proc.py +0 -0
  118. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/normalization_data.py +0 -0
  119. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/numpy_dump.py +0 -0
  120. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/raw_wav.py +0 -0
  121. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/stereo.py +0 -0
  122. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/util/__init__.py +0 -0
  123. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/util/feature_extraction.py +0 -0
  124. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/datasets/util/strings.py +0 -0
  125. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/engine/__init__.py +0 -0
  126. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/engine/base.py +0 -0
  127. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/engine/batch.py +0 -0
  128. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/__init__.py +0 -0
  129. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/__main__.py +0 -0
  130. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/.git +0 -0
  131. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/.gitignore +0 -0
  132. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/LICENSE +0 -0
  133. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/README.md +0 -0
  134. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/aligner.gif +0 -0
  135. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/check.png +0 -0
  136. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/core.cu +0 -0
  137. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/core.h +0 -0
  138. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/core_cpu.cpp +0 -0
  139. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/LICENSE +0 -0
  140. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/MANIFEST.in +0 -0
  141. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/README.md +0 -0
  142. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/binding.cpp +0 -0
  143. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/core.cu +0 -0
  144. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/core.h +0 -0
  145. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/requirements.txt +0 -0
  146. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/setup.py +0 -0
  147. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/warp_rna/__init__.py +0 -0
  148. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/pytorch_binding/warp_rna/test.py +0 -0
  149. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/ref_rna.py +0 -0
  150. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/tensorflow_binding/setup.py +0 -0
  151. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/tensorflow_binding/src/warp_rna_op.cc +0 -0
  152. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/tensorflow_binding/src/warp_rna_op_kernel_tmpl.h +0 -0
  153. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/tensorflow_binding/warp_rna/__init__.py +0 -0
  154. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/WarpRna/warp-rna/test.cpp +0 -0
  155. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/__init__.py +0 -0
  156. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/README.md +0 -0
  157. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/__init__.py +0 -0
  158. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/edit.py +0 -0
  159. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/reroute.py +0 -0
  160. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/select.py +0 -0
  161. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/subgraph.py +0 -0
  162. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/transform.py +0 -0
  163. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/extern/graph_editor/util.py +0 -0
  164. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/forward_iface.py +0 -0
  165. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/__init__.py +0 -0
  166. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/__init__.py +0 -0
  167. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/backend.cpp +0 -0
  168. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/backend.hpp +0 -0
  169. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/module.cpp +0 -0
  170. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/module.hpp +0 -0
  171. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/py_utils.hpp +0 -0
  172. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/tensor_ops.cpp +0 -0
  173. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_native/tensor_ops.hpp +0 -0
  174. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_numpy_backend.py +0 -0
  175. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_random_journal.py +0 -0
  176. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/_utils.py +0 -0
  177. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/attention.py +0 -0
  178. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/audio/__init__.py +0 -0
  179. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/audio/mel.py +0 -0
  180. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/audio/specaugment.py +0 -0
  181. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/backend.py +0 -0
  182. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/cond.py +0 -0
  183. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/const.py +0 -0
  184. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/container.py +0 -0
  185. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/control_flow_ctx.py +0 -0
  186. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/conv.py +0 -0
  187. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/decoder/__init__.py +0 -0
  188. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/decoder/transformer.py +0 -0
  189. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/device.py +0 -0
  190. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/dims.py +0 -0
  191. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/dropout.py +0 -0
  192. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/dtype.py +0 -0
  193. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/encoder/__init__.py +0 -0
  194. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/encoder/base.py +0 -0
  195. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/encoder/conformer.py +0 -0
  196. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/gradient.py +0 -0
  197. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/graph.py +0 -0
  198. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/hooks.py +0 -0
  199. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/init.py +0 -0
  200. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/label_smoothing.py +0 -0
  201. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/linear.py +0 -0
  202. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/loop.py +0 -0
  203. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/loss.py +0 -0
  204. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/math_.py +0 -0
  205. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/matmul.py +0 -0
  206. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/module.py +0 -0
  207. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/normalization.py +0 -0
  208. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/parameter.py +0 -0
  209. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/rand.py +0 -0
  210. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/rec.py +0 -0
  211. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/reduce.py +0 -0
  212. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/run_ctx.py +0 -0
  213. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/signal.py +0 -0
  214. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/state.py +0 -0
  215. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/tensor_array.py +0 -0
  216. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/frontend/types.py +0 -0
  217. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/import_/__init__.py +0 -0
  218. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/import_/common.py +0 -0
  219. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/import_/git.py +0 -0
  220. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/import_/import_.py +0 -0
  221. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/learning_rate_control.py +0 -0
  222. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/log.py +0 -0
  223. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/native_op.cpp +0 -0
  224. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/native_op.py +0 -0
  225. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/pretrain.py +0 -0
  226. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/sprint/__init__.py +0 -0
  227. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/sprint/cache.py +0 -0
  228. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/sprint/control.py +0 -0
  229. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/sprint/error_signals.py +0 -0
  230. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/sprint/extern_interface.py +0 -0
  231. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/sprint/interface.py +0 -0
  232. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/README.md +0 -0
  233. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/__init__.py +0 -0
  234. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/_dim_extra.py +0 -0
  235. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/_tensor_extra.py +0 -0
  236. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/_tensor_mixin_base.py +0 -0
  237. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/_tensor_op_overloads.py +0 -0
  238. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/control_flow_ctx.py +0 -0
  239. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/dim.py +0 -0
  240. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/marked_dim.py +0 -0
  241. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/tensor.py +0 -0
  242. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/tensor_dict.py +0 -0
  243. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tensor/utils.py +0 -0
  244. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/__init__.py +0 -0
  245. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/compat.py +0 -0
  246. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/data_pipeline.py +0 -0
  247. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/distributed.py +0 -0
  248. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/engine.py +0 -0
  249. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/README.md +0 -0
  250. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/__init__.py +0 -0
  251. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/_utils.py +0 -0
  252. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/cond.py +0 -0
  253. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/config_entry_points.py +0 -0
  254. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/debug_eager_mode.py +0 -0
  255. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/dims.py +0 -0
  256. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/layer.py +0 -0
  257. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/loop.py +0 -0
  258. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/make_layer.py +0 -0
  259. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/masked_computation.py +0 -0
  260. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/parameter_assign.py +0 -0
  261. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_layers/prev_tensor_ref.py +0 -0
  262. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_low_level/__init__.py +0 -0
  263. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/frontend_low_level/_backend.py +0 -0
  264. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/horovod.py +0 -0
  265. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/hyper_param_tuning.py +0 -0
  266. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/layers/__init__.py +0 -0
  267. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/layers/base.py +0 -0
  268. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/layers/rec.py +0 -0
  269. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/layers/segmental_model.py +0 -0
  270. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/layers/signal_processing.py +0 -0
  271. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/layers/variable.py +0 -0
  272. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/native_op.py +0 -0
  273. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/network.py +0 -0
  274. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/sprint.py +0 -0
  275. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/updater.py +0 -0
  276. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/util/__init__.py +0 -0
  277. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/util/basic.py +0 -0
  278. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/util/data.py +0 -0
  279. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/util/gradient_checkpoint.py +0 -0
  280. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/util/ken_lm.py +0 -0
  281. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/tf/util/open_fst.py +0 -0
  282. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/README.md +0 -0
  283. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/__init__.py +0 -0
  284. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/data/__init__.py +0 -0
  285. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/data/extern_data.py +0 -0
  286. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/data/pipeline.py +0 -0
  287. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/data/queued_data_iter.py +0 -0
  288. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/data/returnn_dataset_wrapper.py +0 -0
  289. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/data/tensor_utils.py +0 -0
  290. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/frontend/__init__.py +0 -0
  291. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/frontend/_rand.py +0 -0
  292. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/frontend/bridge.py +0 -0
  293. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/frontend/raw_ops.py +0 -0
  294. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/updater.py +0 -0
  295. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/util/README.md +0 -0
  296. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/util/__init__.py +0 -0
  297. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/util/diagnose_gpu.py +0 -0
  298. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/torch/util/scaled_gradient.py +0 -0
  299. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/__init__.py +0 -0
  300. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/better_exchook.py +0 -0
  301. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/bpe.py +0 -0
  302. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/debug.py +0 -0
  303. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/debug_helpers.py +0 -0
  304. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/fsa.py +0 -0
  305. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/literal_py_to_pickle.py +0 -0
  306. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/math.py +0 -0
  307. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/native_code_compiler.py +0 -0
  308. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/pprint.py +0 -0
  309. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/py-to-pickle.cpp +0 -0
  310. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/py_compat.py +0 -0
  311. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/py_ext_mod_compiler.py +0 -0
  312. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/result_with_reason.py +0 -0
  313. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/sig_proc.py +0 -0
  314. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/train_proc_manager.py +0 -0
  315. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn/util/watch_memory.py +0 -0
  316. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn.egg-info/SOURCES.txt +0 -0
  317. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn.egg-info/dependency_links.txt +0 -0
  318. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/returnn.egg-info/top_level.txt +0 -0
  319. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/rnn.py +0 -0
  320. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/setup.cfg +0 -0
  321. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/setup.py +0 -0
  322. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/DummySprintExec.py +0 -0
  323. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm-inspection-profile.xml +0 -0
  324. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/.gitignore +0 -0
  325. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/.name +0 -0
  326. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/codeStyleSettings.xml +0 -0
  327. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/codeStyles/Project.xml +0 -0
  328. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/codeStyles/codeStyleConfig.xml +0 -0
  329. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/inspectionProfiles/Project_Default.xml +0 -0
  330. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/inspectionProfiles/profiles_settings.xml +0 -0
  331. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/misc.xml +0 -0
  332. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/modules.xml +0 -0
  333. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/returnn.iml +0 -0
  334. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/PyCharm.idea/scopes/scope_settings.xml +0 -0
  335. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/_set_num_threads1.py +0 -0
  336. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/_setup_returnn_env.py +0 -0
  337. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/_setup_test_env.py +0 -0
  338. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/bpe-unicode-demo.codes +0 -0
  339. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/bpe-unicode-demo.vocab +0 -0
  340. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/lexicon_opt.fst +0 -0
  341. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/lexicon_opt.isyms +0 -0
  342. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/lexicon_opt.jpg +0 -0
  343. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/lexicon_opt.osyms +0 -0
  344. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/lint_common.py +0 -0
  345. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/pycharm-inspect.py +0 -0
  346. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/pylint.py +0 -0
  347. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/returnn-as-framework.py +0 -0
  348. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/rf_utils.py +0 -0
  349. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/spelling.dic +0 -0
  350. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_Config.py +0 -0
  351. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_Dataset.py +0 -0
  352. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_Fsa.py +0 -0
  353. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_GeneratingDataset.py +0 -0
  354. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_HDFDataset.py +0 -0
  355. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_LearningRateControl.py +0 -0
  356. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_Log.py +0 -0
  357. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_MultiProcDataset.py +0 -0
  358. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_Pretrain.py +0 -0
  359. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_ResNet.py +0 -0
  360. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_SprintDataset.py +0 -0
  361. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_SprintInterface.py +0 -0
  362. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TFNativeOp.py +0 -0
  363. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TFNetworkRecLayer.py +0 -0
  364. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TFNetworkSigProcLayer.py +0 -0
  365. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TFUpdater.py +0 -0
  366. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TFUtil.py +0 -0
  367. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TF_determinism.py +0 -0
  368. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TaskSystem_SharedMem.py +0 -0
  369. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_TranslationDataset.py +0 -0
  370. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_demos.py +0 -0
  371. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_fork_exec.py +0 -0
  372. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_hdf_dump.py +0 -0
  373. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_attention.py +0 -0
  374. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_base.py +0 -0
  375. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_cond.py +0 -0
  376. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_const.py +0 -0
  377. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_container.py +0 -0
  378. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_conv.py +0 -0
  379. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_encoder_conformer.py +0 -0
  380. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_gradient.py +0 -0
  381. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_label_smoothing.py +0 -0
  382. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_loop.py +0 -0
  383. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_math.py +0 -0
  384. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_normalization.py +0 -0
  385. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_rec.py +0 -0
  386. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_reduce.py +0 -0
  387. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_rf_signal.py +0 -0
  388. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_tensor.py +0 -0
  389. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_tools.py +0 -0
  390. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_torch_dataset.py +0 -0
  391. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_torch_engine.py +0 -0
  392. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_torch_frontend.py +0 -0
  393. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tests/test_torch_internal_frontend.py +0 -0
  394. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/_setup_returnn_env.py +0 -0
  395. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/analyze-dataset-batches.py +0 -0
  396. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/bliss-collect-seq-lens.py +0 -0
  397. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/bliss-dump-text.py +0 -0
  398. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/bliss-get-segment-names.py +0 -0
  399. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/bliss-to-ogg-zip.py +0 -0
  400. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/bpe-create-lexicon.py +0 -0
  401. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/calculate-word-error-rate.py +0 -0
  402. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/cleanup-old-models.py +0 -0
  403. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/collect-orth-symbols.py +0 -0
  404. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/collect-words.py +0 -0
  405. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/compile_native_op.py +0 -0
  406. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/compile_tf_graph.py +0 -0
  407. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/debug-dump-search-scores.py +0 -0
  408. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/debug-plot-search-scores.py +0 -0
  409. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/dump-dataset-raw-strings.py +0 -0
  410. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/dump-forward-stats.py +0 -0
  411. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/dump-forward.py +0 -0
  412. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/dump-network-json.py +0 -0
  413. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/dump-pickle.py +0 -0
  414. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/extract_state_tying_from_dataset.py +0 -0
  415. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/get-attention-weights.py +0 -0
  416. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/get-best-model-epoch.py +0 -0
  417. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/hdf_dump.py +0 -0
  418. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/hdf_dump_translation_dataset.py +0 -0
  419. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/import-blocks-mt-model.py +0 -0
  420. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/import-t2t-mt-model.py +0 -0
  421. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/.gitignore +0 -0
  422. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/Makefile +0 -0
  423. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/README.md +0 -0
  424. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/example/README.md +0 -0
  425. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/example/libs_list +0 -0
  426. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/example/network.040/i600_m600_m600.sgd_b16_lr0_cl2.newbobabs.config +0 -0
  427. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/example/network.040/i600_m600_m600.sgd_b16_lr0_cl2.newbobabs.keep_over_epoch.lstm2.config +0 -0
  428. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/example/rescore_lattice.sh +0 -0
  429. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/example/state_vars_list +0 -0
  430. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/example/tensor_names_list +0 -0
  431. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/file.h +0 -0
  432. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/htklatticerescorer.cc +0 -0
  433. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/htklatticerescorer.h +0 -0
  434. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/main.cc +0 -0
  435. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/rescorer.h +0 -0
  436. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/vocabulary.cc +0 -0
  437. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/lattice_rescorer/vocabulary.h +0 -0
  438. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/tf_avg_checkpoints.py +0 -0
  439. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/tf_inspect_checkpoint.py +0 -0
  440. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/tf_inspect_summary_log.py +0 -0
  441. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/torch_avg_checkpoints.py +0 -0
  442. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/torch_inspect_checkpoint.py +0 -0
  443. {returnn-1.20240327.165809 → returnn-1.20240522.175941}/tools/torch_inspect_checkpoint_and_opt.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: returnn
3
- Version: 1.20240327.165809
3
+ Version: 1.20240522.175941
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
@@ -0,0 +1,2 @@
1
+ version = '1.20240522.175941'
2
+ long_version = '1.20240522.175941+git.36de1fe'
@@ -50,6 +50,7 @@ class OggZipDataset(CachedDataset2):
50
50
  segment_file=None,
51
51
  zip_audio_files_have_name_as_prefix=True,
52
52
  fixed_random_subset=None,
53
+ fixed_random_subset_seed=42,
53
54
  epoch_wise_filter=None,
54
55
  **kwargs,
55
56
  ):
@@ -68,7 +69,8 @@ class OggZipDataset(CachedDataset2):
68
69
  Value in [0,1] to specify the fraction, or integer >=1 which specifies number of seqs.
69
70
  If given, will use this random subset. This will be applied initially at loading time,
70
71
  i.e. not dependent on the epoch.
71
- It will use an internally hardcoded fixed random seed, i.e. it's deterministic.
72
+ It uses the fixed fixed_random_subset_seed as seed, i.e. it's deterministic.
73
+ :param int fixed_random_subset_seed: Seed for drawing the fixed random subset, default 42
72
74
  :param dict|None epoch_wise_filter: see init_seq_order
73
75
  """
74
76
  import os
@@ -153,6 +155,7 @@ class OggZipDataset(CachedDataset2):
153
155
  self.num_outputs["data"] = [0, 2]
154
156
  self._data: Optional[List[Dict[str, Any]]] = None # lazily loaded
155
157
  self._fixed_random_subset = fixed_random_subset
158
+ self._fixed_random_subset_seed = fixed_random_subset_seed
156
159
  if epoch_wise_filter is None:
157
160
  self.epoch_wise_filter = None # type: Optional[EpochWiseFilter]
158
161
  elif isinstance(epoch_wise_filter, dict):
@@ -249,7 +252,7 @@ class OggZipDataset(CachedDataset2):
249
252
  if 0 < fixed_random_subset < 1:
250
253
  fixed_random_subset = int(len(data) * fixed_random_subset)
251
254
  assert isinstance(fixed_random_subset, int) and fixed_random_subset > 0
252
- rnd = numpy.random.RandomState(42)
255
+ rnd = numpy.random.RandomState(self._fixed_random_subset_seed)
253
256
  rnd.shuffle(data)
254
257
  data = data[:fixed_random_subset]
255
258
 
@@ -402,9 +402,9 @@ class SprintDatasetBase(Dataset):
402
402
  self.reduce_target_factor,
403
403
  )
404
404
  if "speaker_name" in targets:
405
- targets["speaker_name"] = targets["speaker_name"].decode("utf8").strip()
405
+ targets["speaker_name"] = targets["speaker_name"].strip()
406
406
  if "orth" in targets:
407
- targets["orth"] = targets["orth"].decode("utf8").strip()
407
+ targets["orth"] = targets["orth"].strip()
408
408
  if "orth" in targets and self.orth_post_process:
409
409
  targets["orth"] = self.orth_post_process(targets["orth"])
410
410
  if self.bpe:
@@ -815,7 +815,7 @@ class ExternSprintDataset(SprintDatasetBase):
815
815
 
816
816
  try:
817
817
  init_signal, (input_dim, output_dim, num_segments) = self._read_next_raw()
818
- assert init_signal == b"init"
818
+ assert init_signal == "init"
819
819
  assert isinstance(input_dim, int) and isinstance(output_dim, int)
820
820
  # Ignore num_segments. It can be totally different than the real number of sequences.
821
821
  self.set_dimensions(input_dim, output_dim)
@@ -922,9 +922,7 @@ class ExternSprintDataset(SprintDatasetBase):
922
922
  :return: (data_type, args)
923
923
  :rtype: (str, object)
924
924
  """
925
- # encoding is for converting Python2 strings to Python3.
926
- # Cannot use utf8 because Numpy will also encode the data as strings and there we need it as bytes.
927
- data_type, args = util.read_pickled_object(self.pipe_c2p[0], encoding="bytes")
925
+ data_type, args = util.read_pickled_object(self.pipe_c2p[0])
928
926
  return data_type, args
929
927
 
930
928
  def _join_child(self, wait=True, expected_exit_status=None):
@@ -974,20 +972,16 @@ class ExternSprintDataset(SprintDatasetBase):
974
972
  if self.python_exit or not self.child_pid:
975
973
  break
976
974
 
977
- if data_type == b"data":
975
+ if data_type == "data":
978
976
  seq_count += 1
979
977
  segment_name, features, targets = args
980
- if segment_name is not None:
981
- segment_name = segment_name.decode("utf8")
982
978
  assert isinstance(features, numpy.ndarray)
983
- if isinstance(targets, dict):
984
- targets = {key.decode("utf8"): value for (key, value) in targets.items()}
985
979
  self.add_new_data(
986
980
  numpy_copy_and_set_unused(features),
987
981
  numpy_copy_and_set_unused(targets),
988
982
  segment_name=segment_name,
989
983
  )
990
- elif data_type == b"exit":
984
+ elif data_type == "exit":
991
985
  have_seen_the_whole = True
992
986
  break
993
987
  else:
@@ -1148,7 +1142,7 @@ class SprintCacheDataset(CachedDataset2):
1148
1142
  """
1149
1143
  res = self.sprint_cache.read(name, typ=self.type)
1150
1144
  if self.type == "align":
1151
- for (t, a, s, w) in res:
1145
+ for t, a, s, w in res:
1152
1146
  assert w == 1, "soft alignment not supported"
1153
1147
  label_seq = numpy.array(
1154
1148
  [self.allophone_labeling.get_label_idx(a, s) for (t, a, s, w) in res], dtype=self.dtype
@@ -1156,7 +1150,7 @@ class SprintCacheDataset(CachedDataset2):
1156
1150
  assert label_seq.shape == (len(res),)
1157
1151
  return label_seq
1158
1152
  elif self.type == "align_raw":
1159
- for (t, a, s, w) in res:
1153
+ for t, a, s, w in res:
1160
1154
  assert w == 1, "soft alignment not supported"
1161
1155
  label_seq = numpy.array(
1162
1156
  [self.allophone_labeling.state_tying_by_allo_state_idx[a] for (t, a, s, w) in res], dtype=self.dtype
@@ -13,9 +13,9 @@ __all__ = [
13
13
  "Utf8ByteTargets",
14
14
  ]
15
15
 
16
- import sys
16
+ from typing import Optional, Union, Type, List
17
17
  import typing
18
-
18
+ import sys
19
19
  import numpy
20
20
 
21
21
  from returnn.log import log
@@ -107,13 +107,13 @@ class Vocabulary(object):
107
107
  parts.append("pad_label=%r" % self.id_to_label(self.pad_label_id))
108
108
  return "%s(%s)" % (self.__class__.__name__, ", ".join(parts))
109
109
 
110
- def set_random_seed(self, seed):
110
+ def set_random_seed(self, seed: int):
111
111
  """
112
112
  This can be called for a new epoch or so.
113
113
  Usually it has no effect, as there is no randomness.
114
114
  However, some vocab class could introduce some sampling process.
115
115
 
116
- :param int seed:
116
+ :param seed:
117
117
  """
118
118
  pass # usually there is no randomness, so ignore
119
119
 
@@ -205,12 +205,16 @@ class Vocabulary(object):
205
205
 
206
206
  return init_vocab_var
207
207
 
208
- def to_id(self, label, default=KeyError, allow_none=False):
208
+ def to_id(
209
+ self,
210
+ label: Union[str, int, None],
211
+ default: Union[str, Type[KeyError], None] = KeyError,
212
+ allow_none: bool = False,
213
+ ) -> Optional[int]:
209
214
  """
210
- :param str|int|None label:
211
- :param str|type[KeyError]|None default:
212
- :param bool allow_none: whether label can be None. in this case, None is returned
213
- :rtype: int|None
215
+ :param label:
216
+ :param default:
217
+ :param allow_none: whether label can be None. in this case, None is returned
214
218
  """
215
219
  if isinstance(label, str):
216
220
  return self.label_to_id(label, default=default)
@@ -226,21 +230,19 @@ class Vocabulary(object):
226
230
  return None
227
231
  raise TypeError("invalid label type %r" % type(label))
228
232
 
229
- def label_to_id(self, label, default=KeyError):
233
+ def label_to_id(self, label: str, default: Union[int, Type[KeyError], None] = KeyError) -> Optional[int]:
230
234
  """
231
- :param str label:
232
- :param int|type[KeyError]|None default:
233
- :rtype: int|None
235
+ :param label:
236
+ :param default:
234
237
  """
235
238
  if default is KeyError:
236
239
  return self._vocab[label]
237
240
  return self._vocab.get(label, default)
238
241
 
239
- def id_to_label(self, idx, default=KeyError):
242
+ def id_to_label(self, idx: int, default: Union[str, Type[KeyError], None] = KeyError) -> Optional[str]:
240
243
  """
241
- :param int idx:
242
- :param str|KeyError|None default:
243
- :rtype: str|None
244
+ :param idx:
245
+ :param default:
244
246
  """
245
247
  if self.is_id_valid(idx):
246
248
  return self._labels[idx]
@@ -248,43 +250,43 @@ class Vocabulary(object):
248
250
  raise KeyError("idx %i out of range" % idx)
249
251
  return default
250
252
 
251
- def is_id_valid(self, idx):
253
+ def is_id_valid(self, idx: int) -> bool:
252
254
  """
253
- :param int idx:
254
- :rtype: bool
255
+ :param idx:
255
256
  """
256
257
  return 0 <= idx < len(self._labels)
257
258
 
258
259
  @property
259
- def labels(self):
260
- """
261
- :rtype: list[str]
262
- """
260
+ def labels(self) -> List[str]:
261
+ """list of labels"""
263
262
  return self._labels
264
263
 
265
- def get_seq(self, sentence):
264
+ def get_seq(self, sentence: str) -> List[int]:
266
265
  """
267
- :param str sentence: assumed to be seq of vocab entries separated by whitespace
268
- :rtype: list[int]
266
+ :param sentence: assumed to be seq of vocab entries separated by whitespace
267
+ :return: seq of label indices
269
268
  """
270
269
  segments = sentence.split()
271
270
  return self.get_seq_indices(segments) + self.seq_postfix
272
271
 
273
- def get_seq_indices(self, seq):
272
+ def get_seq_indices(self, seq: List[str]) -> List[int]:
274
273
  """
275
- :param list[str] seq:
276
- :rtype: list[int]
274
+ :param seq: seq of labels (entries in vocab)
275
+ :return: seq of label indices, returns unknown_label_id if unknown_label is set
277
276
  """
278
277
  if self.unknown_label is not None:
279
278
  return [self._vocab.get(k, self.unknown_label_id) for k in seq]
280
279
  return [self._vocab[k] for k in seq]
281
280
 
282
- def get_seq_labels(self, seq):
281
+ def get_seq_labels(self, seq: Union[List[int], numpy.ndarray]) -> str:
283
282
  """
284
- :param list[int]|numpy.ndarray seq: 1D sequence
285
- :rtype: str
283
+ Inverse of :func:`get_seq`.
284
+
285
+ :param seq: 1D sequence of label indices
286
+ :return: serialized sequence string, such that ``get_seq(get_seq_labels(seq)) == seq``
286
287
  """
287
- return " ".join(map(self._labels.__getitem__, seq))
288
+ labels = self.labels
289
+ return " ".join(map(labels.__getitem__, seq))
288
290
 
289
291
 
290
292
  class BytePairEncoding(Vocabulary):
@@ -421,10 +423,8 @@ class SentencePieces(Vocabulary):
421
423
  # Do not load labels/vocab here. This is not really needed.
422
424
 
423
425
  @property
424
- def labels(self):
425
- """
426
- :rtype: list[str]
427
- """
426
+ def labels(self) -> List[str]:
427
+ """list of labels"""
428
428
  if self._cache_key and self._cache_key in self._cache:
429
429
  self._vocab, self._labels = self._cache[self._cache_key]
430
430
  assert self.num_labels == len(self._vocab) == len(self._labels)
@@ -435,28 +435,25 @@ class SentencePieces(Vocabulary):
435
435
  self._cache[self._cache_key] = (self._vocab, self._labels)
436
436
  return self._labels
437
437
 
438
- def is_id_valid(self, idx):
438
+ def is_id_valid(self, idx: int) -> bool:
439
439
  """
440
- :param int idx:
441
- :rtype: bool
440
+ :param idx:
442
441
  """
443
442
  return not self.sp.IsUnused(idx)
444
443
 
445
- def id_to_label(self, idx, default=KeyError):
444
+ def id_to_label(self, idx: int, default: Union[str, Type[KeyError], None] = KeyError) -> Optional[str]:
446
445
  """
447
- :param int idx:
448
- :param str|KeyError|None default:
449
- :rtype: str|None
446
+ :param idx:
447
+ :param default:
450
448
  """
451
449
  if default is not KeyError and not self.is_id_valid(idx):
452
450
  return default
453
451
  return self.sp.IdToPiece(idx)
454
452
 
455
- def label_to_id(self, label, default=KeyError):
453
+ def label_to_id(self, label: str, default: Union[int, Type[KeyError], None] = KeyError) -> Optional[int]:
456
454
  """
457
- :param str label:
458
- :param int|type[KeyError]|None default:
459
- :rtype: int|None
455
+ :param label:
456
+ :param default:
460
457
  """
461
458
  res = self.sp.PieceToId(label)
462
459
  if res == self.unknown_label_id or res < 0 or res is None:
@@ -468,9 +465,9 @@ class SentencePieces(Vocabulary):
468
465
  return default
469
466
  return res
470
467
 
471
- def set_random_seed(self, seed):
468
+ def set_random_seed(self, seed: int):
472
469
  """
473
- :param int seed:
470
+ :param seed:
474
471
  """
475
472
  # Unfortunately, there is only a global seed,
476
473
  # and also, it will only be used for new threads
@@ -480,10 +477,9 @@ class SentencePieces(Vocabulary):
480
477
 
481
478
  spm.set_random_generator_seed(seed)
482
479
 
483
- def get_seq(self, sentence):
480
+ def get_seq(self, sentence: str) -> List[int]:
484
481
  """
485
- :param str sentence: assumed to be seq of vocab entries separated by whitespace
486
- :rtype: list[int]
482
+ :param sentence: assumed to be seq of vocab entries separated by whitespace
487
483
  """
488
484
  return self.sp.encode(sentence, out_type=int) # noqa
489
485
 
@@ -475,6 +475,7 @@ class Backend(Generic[T]):
475
475
  axes: Sequence[Dim],
476
476
  padding: Sequence[Tuple[Union[Dim, int], Union[Dim, int]]],
477
477
  out_dims: Sequence[Dim],
478
+ handle_dynamic_dims: bool,
478
479
  mode: str = "constant",
479
480
  value: Optional[Union[rf.RawTensorTypes, Tensor]] = None,
480
481
  ) -> Tensor:
@@ -483,6 +484,7 @@ class Backend(Generic[T]):
483
484
  :param axes:
484
485
  :param padding:
485
486
  :param out_dims:
487
+ :param handle_dynamic_dims:
486
488
  :param mode:
487
489
  :param value:
488
490
  :return: padded tensor
@@ -4,6 +4,7 @@ Array (Tensor) functions
4
4
 
5
5
  from __future__ import annotations
6
6
  from typing import Optional, Union, Type, TypeVar, Sequence, Tuple
7
+ import logging
7
8
  import numpy
8
9
  from returnn.tensor import Tensor, Dim
9
10
  import returnn.frontend as rf
@@ -385,6 +386,7 @@ def pad(
385
386
  out_dims: Optional[Sequence[Dim]] = None,
386
387
  mode: str = "constant",
387
388
  value: Optional[Union[rf.RawTensorTypes, Tensor]] = None,
389
+ handle_dynamic_dims: Optional[bool] = None,
388
390
  ) -> Tuple[Tensor, Sequence[Dim]]:
389
391
  """
390
392
  Pad values left/right in the specified axes.
@@ -392,9 +394,13 @@ def pad(
392
394
  :param source:
393
395
  :param axes: which axes to add padding to
394
396
  :param padding: list of (left, right) padding for each axis
395
- :param out_dims: (optional) predefined out dim tags, otherwise will automatically create
397
+ :param out_dims: (optional) predefined out dims for each padded dim in axes. will automatically create if not given
396
398
  :param mode: 'constant', 'reflect', 'replicate' or 'circular'
397
399
  :param value: (optional) value to pad with in "constant" mode
400
+ :param handle_dynamic_dims: True: when doing right padding on a dynamic dim, value will be added after the seq end,
401
+ not at the end of the dimension. False: value will be added at the end of the dimension.
402
+ By default, in behavior version >=21, this is True, in older versions, this is False.
403
+ :return: padded tensor, out_dims. out dims are for each dim in axes
398
404
  """
399
405
  assert len(axes) == len(padding)
400
406
  if not out_dims:
@@ -405,13 +411,62 @@ def pad(
405
411
  assert not right.need_masking(), f"padding {padding} does not support dynamic right padding"
406
412
  # Note that even dynamic middle dims is not exactly correct...
407
413
  out_dims = [left + middle + right for middle, (left, right) in zip(axes, padding)]
414
+ if handle_dynamic_dims is None:
415
+ handle_dynamic_dims = _pad_handle_dynamic_dims_default(axes, padding, mode=mode)
408
416
  # noinspection PyProtectedMember
409
417
  return (
410
- source._raw_backend.pad(source, axes=axes, padding=padding, out_dims=out_dims, mode=mode, value=value),
418
+ source._raw_backend.pad(
419
+ source,
420
+ axes=axes,
421
+ padding=padding,
422
+ out_dims=out_dims,
423
+ handle_dynamic_dims=handle_dynamic_dims,
424
+ mode=mode,
425
+ value=value,
426
+ ),
411
427
  out_dims,
412
428
  )
413
429
 
414
430
 
431
+ _pad_handle_dynamic_dims_shown_warning = False
432
+
433
+
434
+ def _pad_handle_dynamic_dims_default(
435
+ pad_axes: Sequence[Dim], padding: Sequence[Tuple[Union[Dim, int], Union[Dim, int]]], *, mode: str
436
+ ) -> bool:
437
+ """
438
+ :param pad_axes: list of axes to pad
439
+ :param padding: list of (left, right) padding for each axis
440
+ :param mode: 'constant', 'reflect', 'replicate' or 'circular'
441
+ :return: True if dynamic dims should be handled as specified in the default behavior
442
+ """
443
+ from returnn.util.basic import BehaviorVersion
444
+
445
+ if BehaviorVersion.get() >= 21:
446
+ return True
447
+
448
+ # Check whether not handling the dynamic dims is safe. Print a warning if not safe.
449
+ global _pad_handle_dynamic_dims_shown_warning
450
+ if not _pad_handle_dynamic_dims_shown_warning:
451
+ for middle, (left, right) in zip(pad_axes, padding):
452
+ middle: Dim
453
+ if not middle.need_masking() and (isinstance(left, int) or not left.need_masking()):
454
+ continue
455
+ if mode != "circular" and isinstance(right, int) and right == 0:
456
+ continue
457
+
458
+ logging.getLogger("returnn.frontend").warning(
459
+ f"rf.pad applied on dynamic dim {middle} but handle_dynamic_dims=False used by default"
460
+ f" due to behavior version {BehaviorVersion.get()} < 21."
461
+ " Set handle_dynamic_dims explicitly to avoid the warning,"
462
+ " or switch to a new behavior version >= 21."
463
+ " (This warning is only printed once.)"
464
+ )
465
+ _pad_handle_dynamic_dims_shown_warning = True
466
+ break
467
+ return False
468
+
469
+
415
470
  def cum_concat_step(
416
471
  source: Tensor, *, prev_accum: Tensor, axis: Dim, out_spatial_dim: Optional[Dim] = None
417
472
  ) -> Tuple[Tensor, Dim]:
@@ -355,6 +355,7 @@ class ReturnnLayersBackend(Backend[Layer]):
355
355
  axes: Sequence[Dim],
356
356
  padding: Sequence[Tuple[Union[Dim, int], Union[Dim, int]]],
357
357
  out_dims: Sequence[Dim],
358
+ handle_dynamic_dims: bool,
358
359
  mode: str = "constant",
359
360
  value: Union[rf.RawTensorTypes, Tensor] = None,
360
361
  ) -> Tensor:
@@ -367,6 +368,7 @@ class ReturnnLayersBackend(Backend[Layer]):
367
368
  "axes": axes,
368
369
  "padding": padding,
369
370
  "out_dims": out_dims,
371
+ "handle_dynamic_dims": handle_dynamic_dims,
370
372
  "mode": mode,
371
373
  "value": value,
372
374
  },
@@ -1981,13 +1981,15 @@ class ScatterNdLayer(_ConcatInputLayer):
1981
1981
  # Now we need to implement a similar logic as `returnn.tf.util.basic.nd_indices`, but more generic.
1982
1982
  idxs = [
1983
1983
  (
1984
- tf.reshape(
1985
- tf.range(pos_shape[i], dtype=pos_v.dtype), [1] * i + [pos_shape[i]] + [1] * (pos_ndim - i - 1)
1984
+ (
1985
+ tf.reshape(
1986
+ tf.range(pos_shape[i], dtype=pos_v.dtype), [1] * i + [pos_shape[i]] + [1] * (pos_ndim - i - 1)
1987
+ )
1988
+ + tf.zeros_like(pos_v)
1986
1989
  )
1987
- + tf.zeros_like(pos_v)
1990
+ if i != replace_common_axis
1991
+ else pos_v
1988
1992
  )
1989
- if i != replace_common_axis
1990
- else pos_v
1991
1993
  for i in range(pos_ndim)
1992
1994
  ]
1993
1995
  nd_idxs = tf.stack(idxs, axis=-1)
@@ -4173,13 +4175,28 @@ class PadLayer(_ConcatInputLayer):
4173
4175
 
4174
4176
  layer_class = "pad"
4175
4177
 
4176
- def __init__(self, axes, padding, out_dims=None, value=0, mode="constant", **kwargs):
4178
+ def __init__(
4179
+ self,
4180
+ *,
4181
+ axes: Union[Dim, str, Sequence[Union[Dim, str]]],
4182
+ padding: Union[int, Tuple[int, int], Sequence[Tuple[int, int]]],
4183
+ out_dims: Optional[Union[Dim, Sequence[Dim]]] = None,
4184
+ handle_dynamic_dims: Optional[bool] = None,
4185
+ value: Union[int, float] = 0,
4186
+ mode: str = "constant",
4187
+ **kwargs,
4188
+ ):
4177
4189
  """
4178
- :param Dim|str|list[Dim|str] axes: e.g. "F" etc. see :func:`Data.get_axes_from_description`.
4179
- :param list[(int,int)]|(int,int)|int padding: how much to pad left/right in each axis
4180
- :param Dim|list[Dim]|None out_dims:
4181
- :param int|float value: what constant value to pad, with mode=="constant"
4182
- :param str mode: "constant", "reflect", "symmetric" and "replication"
4190
+ :param axes: e.g. "F" etc. see :func:`Data.get_axes_from_description`.
4191
+ :param padding: how much to pad left/right in each axis
4192
+ :param out_dims:
4193
+ :param handle_dynamic_dims: True: when doing right padding on a dynamic dim,
4194
+ value will be added after the seq end,
4195
+ not at the end of the dimension.
4196
+ False: value will be added at the end of the dimension.
4197
+ By default, in behavior version >=21, this is True, in older versions, this is False.
4198
+ :param value: what constant value to pad, with mode=="constant"
4199
+ :param mode: "constant", "reflect", "symmetric" and "replication"
4183
4200
  """
4184
4201
  out_dims # noqa # handled in get_out_data_from_opts
4185
4202
  super(PadLayer, self).__init__(**kwargs)
@@ -4190,15 +4207,47 @@ class PadLayer(_ConcatInputLayer):
4190
4207
  paddings = [(0, 0)] * len(range(self.input_data.batch_ndim))
4191
4208
  for i, a in enumerate(axes):
4192
4209
  paddings[a] = padding[i]
4193
- mode = mode.upper()
4210
+ mode = mode.lower()
4211
+ if handle_dynamic_dims is None:
4212
+ handle_dynamic_dims = self._handle_dynamic_dims_default(
4213
+ pad_axes=[self.input_data.dims[axis] for axis in axes_],
4214
+ padding=padding,
4215
+ mode=mode,
4216
+ )
4194
4217
  if all(sum(p) == 0 for p in padding):
4195
4218
  self.output.placeholder = self.input_data.placeholder
4196
- elif mode == "REPLICATION":
4219
+ elif mode == "replication":
4197
4220
  self.output.placeholder = tf_util.pad_replicate(self.input_data.placeholder, axes, padding)
4198
4221
  else:
4199
4222
  self.output.placeholder = tf.pad(
4200
4223
  self.input_data.placeholder, paddings=paddings, mode=mode, constant_values=value
4201
4224
  )
4225
+ if all(right == 0 for left, right in padding) and mode != "circular":
4226
+ pass # no masking needed
4227
+ else:
4228
+ import returnn.frontend as rf
4229
+
4230
+ for middle_axis, (left, right) in zip(axes, padding):
4231
+ out_dim: Dim = self.output.dims[middle_axis]
4232
+ middle = self.input_data.dims[middle_axis]
4233
+ if handle_dynamic_dims and middle.need_masking() or (isinstance(left, Dim) and left.need_masking()):
4234
+ if mode != "constant":
4235
+ raise NotImplementedError(
4236
+ f"pad: mode {mode} not implemented with dynamic dims and handle_dynamic_dims=True"
4237
+ )
4238
+ if isinstance(right, Dim) or right > 0:
4239
+ mask = rf.compare_bc(
4240
+ rf.range_over_dim(out_dim),
4241
+ "<",
4242
+ (left + middle)
4243
+ .get_for_batch_ctx(self.output.batch, self.output.control_flow_ctx)
4244
+ .dyn_size_ext,
4245
+ )
4246
+ self.output.raw_tensor = tf_util.where_bc(
4247
+ mask.copy_compatible_to(self.output, check_sparse=False, check_dtype=False).raw_tensor,
4248
+ self.output.raw_tensor,
4249
+ tf.convert_to_tensor(value, dtype=self.output.dtype),
4250
+ )
4202
4251
 
4203
4252
  @classmethod
4204
4253
  def _transform_padding(cls, padding, axes):
@@ -4218,6 +4267,45 @@ class PadLayer(_ConcatInputLayer):
4218
4267
  padding = [(padding, padding)] * len(axes)
4219
4268
  return padding
4220
4269
 
4270
+ _handle_dynamic_dims_shown_warning = False
4271
+
4272
+ @classmethod
4273
+ def _handle_dynamic_dims_default(
4274
+ cls, pad_axes: Sequence[Dim], padding: Sequence[Tuple[Union[Dim, int], Union[Dim, int]]], *, mode: str
4275
+ ) -> bool:
4276
+ """
4277
+ :param pad_axes: list of axes to pad
4278
+ :param padding: list of (left, right) padding for each axis
4279
+ :param mode: 'constant', 'reflect', 'replicate' or 'circular'
4280
+ :return: True if dynamic dims should be handled as specified in the default behavior
4281
+ """
4282
+ from returnn.util.basic import BehaviorVersion
4283
+
4284
+ if BehaviorVersion.get() >= 21:
4285
+ return True
4286
+
4287
+ # Check whether not handling the dynamic dims is safe. Print a warning if not safe.
4288
+ if not cls._handle_dynamic_dims_shown_warning:
4289
+ import logging
4290
+
4291
+ for middle, (left, right) in zip(pad_axes, padding):
4292
+ middle: Dim
4293
+ if not middle.need_masking() and (isinstance(left, int) or not left.need_masking()):
4294
+ continue
4295
+ if mode != "circular" and isinstance(right, int) and right == 0:
4296
+ continue
4297
+
4298
+ logging.getLogger("returnn.tf").warning(
4299
+ f"PadLayer applied on dynamic dim {middle} but handle_dynamic_dims=False used by default"
4300
+ f" due to behavior version {BehaviorVersion.get()} < 21."
4301
+ " Set handle_dynamic_dims explicitly to avoid the warning,"
4302
+ " or switch to a new behavior version >= 21."
4303
+ " (This warning is only printed once.)"
4304
+ )
4305
+ cls._handle_dynamic_dims_shown_warning = True
4306
+ break
4307
+ return False
4308
+
4221
4309
  @classmethod
4222
4310
  def get_out_data_from_opts(cls, name, sources, axes, padding, out_dims=None, **kwargs):
4223
4311
  """
@@ -4929,14 +5017,16 @@ class SplitDimsLayer(_ConcatInputLayer):
4929
5017
  rem_dim = None
4930
5018
  if not resolved_dims:
4931
5019
  resolved_dims = tuple(
4932
- Dim(
4933
- kind=axis_dim_tag.kind if not axis_dim_tag.is_batch_dim() else Dim.Types.Spatial,
4934
- description="%s_split_dims%i" % (name, i),
4935
- dimension=shape_dim,
4936
- auto_generated=True,
5020
+ (
5021
+ Dim(
5022
+ kind=axis_dim_tag.kind if not axis_dim_tag.is_batch_dim() else Dim.Types.Spatial,
5023
+ description="%s_split_dims%i" % (name, i),
5024
+ dimension=shape_dim,
5025
+ auto_generated=True,
5026
+ )
5027
+ if rem_dim is None or i != rem_dim_idx
5028
+ else rem_dim
4937
5029
  )
4938
- if rem_dim is None or i != rem_dim_idx
4939
- else rem_dim
4940
5030
  for i, shape_dim in enumerate(resolved_shape_dims)
4941
5031
  )
4942
5032
  out_batch = data.batch