hyperverse 0.0.1__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.
Files changed (746) hide show
  1. hyperdrone/__init__.py +31 -0
  2. hyperdrone/_native/cmake/hyperdrone_jit.cmake +65 -0
  3. hyperdrone/_native/common/bindings.h +39 -0
  4. hyperdrone/_native/common/cuda_staging.h +75 -0
  5. hyperdrone/_native/common/jit_host.h +69 -0
  6. hyperdrone/_native/common/models.h +24 -0
  7. hyperdrone/_native/dynamics/CMakeLists.txt +61 -0
  8. hyperdrone/_native/dynamics/host.cpp +193 -0
  9. hyperdrone/_native/dynamics/iface.h +76 -0
  10. hyperdrone/_native/dynamics/impl.cpp +608 -0
  11. hyperdrone/_native/env/CMakeLists.txt +71 -0
  12. hyperdrone/_native/env/environment.cpp +124 -0
  13. hyperdrone/_native/env/environment.h +407 -0
  14. hyperdrone/_native/env/rotorcraft_bindings.cpp +51 -0
  15. hyperdrone/_native/render/CMakeLists.txt +94 -0
  16. hyperdrone/_native/render/renderer.cpp +962 -0
  17. hyperdrone/_native/render/rig_bindings.h +151 -0
  18. hyperdrone/_native/render/scene_bindings.cpp +466 -0
  19. hyperdrone/_vendor/rl-tools/CMakeLists.txt +205 -0
  20. hyperdrone/_vendor/rl-tools/LICENSE +21 -0
  21. hyperdrone/_vendor/rl-tools/cmake/autodetect/all.cmake +34 -0
  22. hyperdrone/_vendor/rl-tools/cmake/autodetect/git-diff.cmake +100 -0
  23. hyperdrone/_vendor/rl-tools/cmake/autodetect/git-hash.cmake +24 -0
  24. hyperdrone/_vendor/rl-tools/cmake/autodetect/summary.cmake +64 -0
  25. hyperdrone/_vendor/rl-tools/cmake/autodetect/tier0-compiler.cmake +18 -0
  26. hyperdrone/_vendor/rl-tools/cmake/autodetect/tier1-blas.cmake +51 -0
  27. hyperdrone/_vendor/rl-tools/cmake/autodetect/tier2-json-hdf5-zlib.cmake +81 -0
  28. hyperdrone/_vendor/rl-tools/cmake/autodetect/tier3-tensorboard.cmake +25 -0
  29. hyperdrone/_vendor/rl-tools/cmake/autodetect/tier4-cuda.cmake +42 -0
  30. hyperdrone/_vendor/rl-tools/cmake/autodetect/tier5-cli11.cmake +24 -0
  31. hyperdrone/_vendor/rl-tools/cmake/dependencies/assimp.cmake +19 -0
  32. hyperdrone/_vendor/rl-tools/cmake/legacy_flags.cmake +33 -0
  33. hyperdrone/_vendor/rl-tools/cmake/optional/assimp.cmake +30 -0
  34. hyperdrone/_vendor/rl-tools/cmake/optional/googletest.cmake +20 -0
  35. hyperdrone/_vendor/rl-tools/cmake/optional/metal.cmake +25 -0
  36. hyperdrone/_vendor/rl-tools/cmake/optional/mujoco.cmake +89 -0
  37. hyperdrone/_vendor/rl-tools/cmake/optional/optix.cmake +25 -0
  38. hyperdrone/_vendor/rl-tools/cmake/optional/raytracing.cmake +105 -0
  39. hyperdrone/_vendor/rl-tools/cmake/optional/raytracing_generic.cmake +2 -0
  40. hyperdrone/_vendor/rl-tools/cmake/optional/vulkan.cmake +4 -0
  41. hyperdrone/_vendor/rl-tools/cmake/optional/webgpu.cmake +24 -0
  42. hyperdrone/_vendor/rl-tools/cmake/scripts/embed_text.cmake +7 -0
  43. hyperdrone/_vendor/rl-tools/cmake/scripts/generate-git-snapshot.cmake +138 -0
  44. hyperdrone/_vendor/rl-tools/include/conta/conta.h +1161 -0
  45. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/matrix.h +143 -0
  46. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_arm.h +33 -0
  47. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu.h +314 -0
  48. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_accelerate.h +37 -0
  49. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_blas.h +67 -0
  50. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_mkl.h +38 -0
  51. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_openblas.h +34 -0
  52. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cuda.h +289 -0
  53. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_dummy.h +20 -0
  54. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_esp32.h +29 -0
  55. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_generic.h +944 -0
  56. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_wasm32.h +13 -0
  57. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/persist_code.h +136 -0
  58. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_arm.h +1 -0
  59. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu.h +94 -0
  60. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_accelerate.h +25 -0
  61. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_blas.h +115 -0
  62. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_mkl.h +25 -0
  63. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_openblas.h +25 -0
  64. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cuda.h +713 -0
  65. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_generic.h +1356 -0
  66. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/persist_code.h +130 -0
  67. hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/tensor.h +490 -0
  68. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/arm.h +91 -0
  69. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu.h +209 -0
  70. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_accelerate.h +23 -0
  71. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_blas.h +21 -0
  72. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_mkl.h +45 -0
  73. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_openblas.h +56 -0
  74. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_tensorboard.h +34 -0
  75. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cuda.h +415 -0
  76. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/devices.h +97 -0
  77. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/dummy.h +55 -0
  78. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/esp32.h +85 -0
  79. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/generic.h +0 -0
  80. hyperdrone/_vendor/rl-tools/include/rl_tools/devices/wasm32.h +59 -0
  81. hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/model.h +218 -0
  82. hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/operations_generic.h +769 -0
  83. hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/persist.h +278 -0
  84. hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter.h +100 -0
  85. hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter_persist.h +52 -0
  86. hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/tensor_operations_generic.h +55 -0
  87. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_backend.h +117 -0
  88. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_interface.h +36 -0
  89. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/l2f.h +98 -0
  90. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_dyn.h +18 -0
  91. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_generic.h +268 -0
  92. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_backend.h +31 -0
  93. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_interface.h +12 -0
  94. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_backend.h +98 -0
  95. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_interface.h +50 -0
  96. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/executor.h +133 -0
  97. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/helper.h +109 -0
  98. hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/operations_generic.h +219 -0
  99. hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arduino.h +117 -0
  100. hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arm.h +56 -0
  101. hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu.h +93 -0
  102. hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu_tensorboard.h +151 -0
  103. hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cuda.h +65 -0
  104. hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_dummy.h +45 -0
  105. hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_wasm32.h +56 -0
  106. hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_arm.h +98 -0
  107. hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cpu.h +138 -0
  108. hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cuda.h +380 -0
  109. hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_dummy.h +93 -0
  110. hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_esp32.h +92 -0
  111. hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_generic.h +295 -0
  112. hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_wasm32.h +230 -0
  113. hyperdrone/_vendor/rl-tools/include/rl_tools/mode/mode.h +98 -0
  114. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/activation_functions.h +113 -0
  115. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/capability.h +61 -0
  116. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/persist_code.h +31 -0
  117. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/group.h +99 -0
  118. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/layer.h +122 -0
  119. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_cuda.h +64 -0
  120. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_generic.h +186 -0
  121. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/persist.h +33 -0
  122. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/layer.h +300 -0
  123. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cpu_mkl.h +590 -0
  124. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cuda.h +809 -0
  125. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_generic.h +1219 -0
  126. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist.h +99 -0
  127. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist_code.h +170 -0
  128. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/layer.h +145 -0
  129. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/dsp.h +63 -0
  130. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/opt.h +173 -0
  131. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu.h +13 -0
  132. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_accelerate.h +66 -0
  133. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_blas.h +282 -0
  134. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_mkl.h +66 -0
  135. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_openblas.h +65 -0
  136. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cuda.h +519 -0
  137. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_dummy.h +8 -0
  138. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/dsp.h +58 -0
  139. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/opt.h +167 -0
  140. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_generic.h +429 -0
  141. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist.h +62 -0
  142. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_code.h +178 -0
  143. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_common.h +59 -0
  144. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/layer.h +188 -0
  145. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_cuda.h +356 -0
  146. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_generic.h +536 -0
  147. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/persist.h +32 -0
  148. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/layer.h +119 -0
  149. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/operations_generic.h +223 -0
  150. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/persist.h +46 -0
  151. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/layer.h +121 -0
  152. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/operations_generic.h +154 -0
  153. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist.h +44 -0
  154. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist_code.h +106 -0
  155. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_cuda.h +602 -0
  156. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_generic.h +251 -0
  157. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/layer.h +206 -0
  158. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/operations_generic.h +889 -0
  159. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist.h +75 -0
  160. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist_code.h +199 -0
  161. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/layers.h +3 -0
  162. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/layer.h +143 -0
  163. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_cuda.h +80 -0
  164. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_generic.h +216 -0
  165. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/persist.h +39 -0
  166. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu.h +1 -0
  167. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_accelerate.h +1 -0
  168. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_blas.h +1 -0
  169. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_mkl.h +3 -0
  170. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_openblas.h +1 -0
  171. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cuda.h +9 -0
  172. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_dummy.h +1 -0
  173. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_generic.h +3 -0
  174. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/layer.h +223 -0
  175. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_cuda.h +138 -0
  176. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_generic.h +446 -0
  177. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/persist.h +70 -0
  178. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/layer.h +154 -0
  179. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_cuda.h +119 -0
  180. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_generic.h +502 -0
  181. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist.h +50 -0
  182. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist_code.h +173 -0
  183. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/layer.h +116 -0
  184. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_cuda.h +156 -0
  185. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_generic.h +295 -0
  186. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist.h +83 -0
  187. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist_code.h +163 -0
  188. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/layer.h +123 -0
  189. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/operations_generic.h +272 -0
  190. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist.h +17 -0
  191. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist_code.h +164 -0
  192. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/layer.h +122 -0
  193. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_cuda.h +55 -0
  194. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_generic.h +160 -0
  195. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist.h +47 -0
  196. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist_code.h +106 -0
  197. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/layer.h +132 -0
  198. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_cuda.h +141 -0
  199. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_generic.h +230 -0
  200. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/categorical_cross_entropy/operations_generic.h +102 -0
  201. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_cuda.h +97 -0
  202. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_generic.h +101 -0
  203. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/operations_generic.h +2 -0
  204. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/nn.h +14 -0
  205. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu.h +1 -0
  206. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_accelerate.h +1 -0
  207. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_blas.h +1 -0
  208. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mkl.h +1 -0
  209. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mux.h +16 -0
  210. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_openblas.h +1 -0
  211. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cuda.h +2 -0
  212. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_dummy.h +1 -0
  213. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_generic.h +15 -0
  214. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/adam.h +121 -0
  215. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_cuda.h +98 -0
  216. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_generic.h +150 -0
  217. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist.h +39 -0
  218. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist_code.h +80 -0
  219. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_cuda.h +85 -0
  220. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_generic.h +109 -0
  221. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/persist.h +25 -0
  222. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/instance/operations_generic.h +107 -0
  223. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/lamb.h +40 -0
  224. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/operations_generic.h +68 -0
  225. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/optimizers.h +3 -0
  226. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_cuda.h +85 -0
  227. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_generic.h +140 -0
  228. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist.h +37 -0
  229. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist_code.h +72 -0
  230. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_cuda.h +49 -0
  231. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_generic.h +50 -0
  232. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/sgd.h +92 -0
  233. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/update.h +54 -0
  234. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_cuda.h +0 -0
  235. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_generic.h +98 -0
  236. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/parameters.h +79 -0
  237. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist.h +34 -0
  238. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist_code.h +136 -0
  239. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist.h +2 -0
  240. hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist_code.h +27 -0
  241. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/behaviors/skip_parameter_gradients.h +65 -0
  242. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/group/README.md +107 -0
  243. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/group/model.h +19 -0
  244. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/group/persist_code.h +77 -0
  245. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/network.h +174 -0
  246. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_cuda.h +10 -0
  247. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_dummy.h +8 -0
  248. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_generic.h +407 -0
  249. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist.h +56 -0
  250. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist_code.h +137 -0
  251. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/network.h +55 -0
  252. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/operations_generic.h +86 -0
  253. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist.h +43 -0
  254. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist_code.h +142 -0
  255. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/models.h +3 -0
  256. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/model.h +148 -0
  257. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/operations_generic.h +288 -0
  258. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist.h +25 -0
  259. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist_code.h +71 -0
  260. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cpu.h +0 -0
  261. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cuda.h +1 -0
  262. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_dummy.h +1 -0
  263. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_generic.h +4 -0
  264. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/model.h +290 -0
  265. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_cuda.h +174 -0
  266. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_generic.h +623 -0
  267. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist.h +80 -0
  268. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist_code.h +200 -0
  269. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist.h +1 -0
  270. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist_code.h +1 -0
  271. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/model.h +43 -0
  272. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/operations_generic.h +73 -0
  273. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/resnet/resnet.h +97 -0
  274. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/model.h +270 -0
  275. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/operations_generic.h +625 -0
  276. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist.h +99 -0
  277. hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist_code.h +115 -0
  278. hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/bf16.h +28 -0
  279. hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/categories.h +22 -0
  280. hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/persist_code.h +54 -0
  281. hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/policy.h +48 -0
  282. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_1.h +18 -0
  283. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_2.h +14 -0
  284. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_3.h +14 -0
  285. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm.h +19 -0
  286. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_1.h +17 -0
  287. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_2.h +12 -0
  288. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_3.h +15 -0
  289. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu.h +19 -0
  290. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_1.h +16 -0
  291. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_2.h +12 -0
  292. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_3.h +15 -0
  293. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate.h +19 -0
  294. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_1.h +17 -0
  295. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_2.h +12 -0
  296. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_3.h +15 -0
  297. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl.h +18 -0
  298. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mux.h +148 -0
  299. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_1.h +16 -0
  300. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_2.h +12 -0
  301. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_3.h +15 -0
  302. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas.h +18 -0
  303. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_1.h +16 -0
  304. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_2.h +12 -0
  305. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_3.h +15 -0
  306. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard.h +19 -0
  307. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_1.h +18 -0
  308. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_2.h +12 -0
  309. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_3.h +12 -0
  310. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda.h +19 -0
  311. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_1.h +15 -0
  312. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_2.h +12 -0
  313. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_3.h +12 -0
  314. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy.h +19 -0
  315. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_1.h +16 -0
  316. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_2.h +12 -0
  317. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_3.h +13 -0
  318. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32.h +19 -0
  319. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_1.h +15 -0
  320. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_2.h +12 -0
  321. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_3.h +12 -0
  322. hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32.h +19 -0
  323. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/hdf5.h +54 -0
  324. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/operations_cpu.h +419 -0
  325. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/io.h +55 -0
  326. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_cpu.h +58 -0
  327. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_generic.h +620 -0
  328. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_posix.h +63 -0
  329. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/tar.h +74 -0
  330. hyperdrone/_vendor/rl-tools/include/rl_tools/persist/code.h +38 -0
  331. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_arm.h +39 -0
  332. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cpu.h +81 -0
  333. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cuda.h +169 -0
  334. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_dummy.h +72 -0
  335. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_esp32.h +45 -0
  336. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic.h +133 -0
  337. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic_array.h +73 -0
  338. hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_wasm32.h +57 -0
  339. hyperdrone/_vendor/rl-tools/include/rl_tools/random/persist.h +77 -0
  340. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/camera.h +105 -0
  341. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/annotations/cache.h +26 -0
  342. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/annotations/free_space.h +60 -0
  343. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/annotations/operations_cpu.h +408 -0
  344. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/glb/operations_cpu.h +1313 -0
  345. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/operations_cpu.h +96 -0
  346. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/procthor/conversion.h +33 -0
  347. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/procthor/operations_cpu.h +141 -0
  348. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/procthor/procthor.h +40 -0
  349. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_cpu.h +733 -0
  350. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_generic.h +1299 -0
  351. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/context.h +198 -0
  352. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/device_source.h +17 -0
  353. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/operations_cpu.h +1140 -0
  354. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device.h +233 -0
  355. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device_impl.h +1084 -0
  356. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/operations_cuda.h +1808 -0
  357. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/overlay_accel.h +64 -0
  358. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/specialization.h +38 -0
  359. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/context.h +248 -0
  360. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/device_source.h +48 -0
  361. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/operations_cpu.h +2056 -0
  362. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/bvh_sah.h +182 -0
  363. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/context.h +303 -0
  364. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/device_source.h +17 -0
  365. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/operations_cpu.h +1455 -0
  366. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_common.h +916 -0
  367. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_mux.h +31 -0
  368. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_post.h +85 -0
  369. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/renderer.h +478 -0
  370. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/save_cpu.h +315 -0
  371. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene.h +44 -0
  372. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/transforms_generic.h +25 -0
  373. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/types.h +45 -0
  374. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/rig/operations_cpu.h +119 -0
  375. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/rig/operations_generic.h +121 -0
  376. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/rig/rig.h +70 -0
  377. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/scene.h +134 -0
  378. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/segmentation_cpu.h +145 -0
  379. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/transforms.h +204 -0
  380. hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/types.h +55 -0
  381. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/algorithms.h +6 -0
  382. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu.h +1 -0
  383. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu_mkl.h +1 -0
  384. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_generic.h +1 -0
  385. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/config.h +243 -0
  386. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_cuda.h +9 -0
  387. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_generic.h +205 -0
  388. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/persist.h +109 -0
  389. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/state.h +51 -0
  390. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/mixed_imitation.h +63 -0
  391. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_cuda.h +190 -0
  392. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic.h +332 -0
  393. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic_mixed_imitation.h +81 -0
  394. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/persist.h +28 -0
  395. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/ppo.h +105 -0
  396. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_gru.h +84 -0
  397. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_mlp.h +61 -0
  398. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/config.h +106 -0
  399. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/operations_generic.h +193 -0
  400. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/state.h +52 -0
  401. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu.h +9 -0
  402. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_accelerate.h +2 -0
  403. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mkl.h +2 -0
  404. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mux.h +9 -0
  405. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cuda.h +131 -0
  406. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_generic.h +580 -0
  407. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/sac.h +151 -0
  408. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_gru.h +72 -0
  409. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_mlp.h +54 -0
  410. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/config.h +107 -0
  411. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/operations_generic.h +174 -0
  412. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/state.h +46 -0
  413. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu.h +9 -0
  414. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_accelerate.h +2 -0
  415. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mkl.h +2 -0
  416. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mux.h +9 -0
  417. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cuda.h +117 -0
  418. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_generic.h +359 -0
  419. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/td3.h +141 -0
  420. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/components.h +4 -0
  421. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/off_policy_runner.h +225 -0
  422. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu.h +95 -0
  423. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_accelerate.h +21 -0
  424. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_mkl.h +21 -0
  425. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cuda.h +237 -0
  426. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic.h +498 -0
  427. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic_per_env.h +112 -0
  428. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/collection.h +57 -0
  429. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/on_policy_runner.h +122 -0
  430. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu.h +2 -0
  431. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_accelerate.h +8 -0
  432. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_mkl.h +8 -0
  433. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_mux.h +12 -0
  434. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cuda.h +183 -0
  435. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic.h +366 -0
  436. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic_common.h +74 -0
  437. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/persist.h +47 -0
  438. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu.h +2 -0
  439. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_accelerate.h +1 -0
  440. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_mkl.h +1 -0
  441. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_generic.h +2 -0
  442. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_cpu.h +9 -0
  443. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_generic.h +123 -0
  444. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/persist.h +57 -0
  445. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/replay_buffer.h +93 -0
  446. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/operations_generic.h +76 -0
  447. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/persist.h +31 -0
  448. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/running_normalizer.h +33 -0
  449. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/operations_generic.h +58 -0
  450. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/operations_generic.h +28 -0
  451. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/wrapper.h +26 -0
  452. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/wrappers.h +29 -0
  453. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/acrobot.h +88 -0
  454. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_cpu.h +152 -0
  455. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_generic.h +202 -0
  456. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/environment.h +40 -0
  457. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/operations_cuda.h +204 -0
  458. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/operations_generic.h +106 -0
  459. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/operations_generic_common.h +26 -0
  460. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/persist.h +33 -0
  461. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/car.h +119 -0
  462. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_cpu.h +110 -0
  463. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_generic.h +206 -0
  464. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_json.h +59 -0
  465. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/track.h +23 -0
  466. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/ui.h +189 -0
  467. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/environments.h +28 -0
  468. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/environment.h +87 -0
  469. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_cpu.h +212 -0
  470. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_generic.h +215 -0
  471. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/observation.h +75 -0
  472. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/operations_cpu.h +938 -0
  473. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/operations_cuda.h +380 -0
  474. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/pose.h +228 -0
  475. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/presets.h +148 -0
  476. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/rig/operations_cpu.h +189 -0
  477. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/rig/operations_generic.h +32 -0
  478. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/rig/rig.h +25 -0
  479. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/moving_gate/moving_gate.h +106 -0
  480. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/moving_gate/operations_cpu.h +262 -0
  481. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/moving_gate/operations_cuda.h +254 -0
  482. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/operations_cpu.h +224 -0
  483. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/operations_cuda.h +218 -0
  484. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/operations_generic_position_hold.h +128 -0
  485. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/position_hold.h +22 -0
  486. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/target_frame.h +77 -0
  487. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/autopilot.h +61 -0
  488. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/baseline.h +46 -0
  489. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/calibration.h +62 -0
  490. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/metrics.h +101 -0
  491. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/operations_cpu.h +389 -0
  492. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/visual_inertial_localization.h +123 -0
  493. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/world.h +318 -0
  494. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/inertial_velocity.h +27 -0
  495. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/metrics.h +266 -0
  496. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/multirotor.h +1138 -0
  497. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_cpu.h +2246 -0
  498. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/05_state_is_nan.h +148 -0
  499. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/10_sample_initial_parameters.h +228 -0
  500. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/20_initial_state.h +208 -0
  501. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/30_sample_initial_state.h +300 -0
  502. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/35_get_desired_state.h +63 -0
  503. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/40_observe.h +637 -0
  504. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/50_state_algebra.h +57 -0
  505. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/60_dynamics.h +134 -0
  506. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/70_post_integration.h +368 -0
  507. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/80_abs_diff.h +312 -0
  508. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic.h +367 -0
  509. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic_inertial_velocity.h +44 -0
  510. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_helper_generic.h +43 -0
  511. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic.h +70 -0
  512. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic_forward.h +24 -0
  513. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/default.h +209 -0
  514. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/arpl.h +112 -0
  515. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie.h +127 -0
  516. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie_openmv.h +119 -0
  517. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/flightmare.h +111 -0
  518. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/fs.h +113 -0
  519. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/mrs.h +110 -0
  520. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft.h +117 -0
  521. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft_rigid.h +118 -0
  522. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500.h +88 -0
  523. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_real.h +88 -0
  524. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_sim.h +114 -0
  525. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/init/default.h +56 -0
  526. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/registry.h +96 -0
  527. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/default.h +64 -0
  528. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/reward_functions.h +1 -0
  529. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/operations_generic.h +202 -0
  530. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/squared.h +52 -0
  531. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/termination/default.h +33 -0
  532. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/lissajous.h +72 -0
  533. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/trajectory.h +78 -0
  534. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/persist.h +21 -0
  535. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/persist_code.h +53 -0
  536. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/quaternion_helper.h +103 -0
  537. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/ui.h +180 -0
  538. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/environment.h +69 -0
  539. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_cpu.h +46 -0
  540. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_generic.h +78 -0
  541. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/README.MD +5 -0
  542. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ant.h +77 -0
  543. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/model.h +415 -0
  544. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/operations_cpu.h +162 -0
  545. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/persist.h +86 -0
  546. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ui.h +141 -0
  547. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/mujoco.h +1 -0
  548. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/bottleneck.h +113 -0
  549. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_cpu.h +289 -0
  550. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_generic.h +495 -0
  551. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/environments.h +16 -0
  552. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/observation.h +37 -0
  553. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_cpu.h +2 -0
  554. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_generic.h +33 -0
  555. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_cpu.h +146 -0
  556. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_generic.h +262 -0
  557. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/pendulum.h +197 -0
  558. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui.h +97 -0
  559. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui_xeus.h +124 -0
  560. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_cpu.h +426 -0
  561. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_generic.h +424 -0
  562. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/reacher.h +137 -0
  563. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/loop.h +15 -0
  564. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/config.h +28 -0
  565. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/operations_cpu.h +233 -0
  566. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/persist.h +30 -0
  567. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/state.h +21 -0
  568. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/config.h +25 -0
  569. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/operations_generic.h +47 -0
  570. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/persist.h +20 -0
  571. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/state.h +17 -0
  572. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/config.h +47 -0
  573. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/operations_generic.h +106 -0
  574. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/persist.h +40 -0
  575. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/state.h +36 -0
  576. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/config.h +22 -0
  577. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/operations_cpu.h +44 -0
  578. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/persist.h +20 -0
  579. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/state.h +26 -0
  580. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/config.h +37 -0
  581. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/operations_cpu.h +113 -0
  582. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/persist.h +20 -0
  583. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/state.h +24 -0
  584. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/config.h +43 -0
  585. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/operations_cpu.h +190 -0
  586. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/persist.h +30 -0
  587. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/state.h +37 -0
  588. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/steps.h +4 -0
  589. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/config.h +27 -0
  590. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/operations_cpu.h +52 -0
  591. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/persist.h +20 -0
  592. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/state.h +25 -0
  593. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/operations_generic.h +3 -0
  594. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/rl.h +5 -0
  595. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/evaluation.h +106 -0
  596. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_cpu.h +48 -0
  597. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_generic.h +275 -0
  598. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation.h +269 -0
  599. hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation_analysis.h +85 -0
  600. hyperdrone/_vendor/rl-tools/include/rl_tools/rl_tools.h +80 -0
  601. hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/client.h +50 -0
  602. hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_boost.h +92 -0
  603. hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_cpu.h +174 -0
  604. hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_websocket.h +208 -0
  605. hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/server.h +448 -0
  606. hyperdrone/_vendor/rl-tools/include/rl_tools/universe.h +4 -0
  607. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/declarations_cpu.h +13 -0
  608. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_arm.h +29 -0
  609. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cpu.h +25 -0
  610. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cuda.h +33 -0
  611. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_dummy.h +18 -0
  612. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_esp32.h +20 -0
  613. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_generic.h +19 -0
  614. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_wasm32.h +18 -0
  615. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_cpu.h +16 -0
  616. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_generic.h +14 -0
  617. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/extrack.h +129 -0
  618. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/operations_cpu.h +588 -0
  619. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/integrators.h +103 -0
  620. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/memcpy.h +16 -0
  621. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/operations_generic.h +48 -0
  622. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/tuple.h +147 -0
  623. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/typing.h +122 -0
  624. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/vector_operations.h +172 -0
  625. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_cuda.h +53 -0
  626. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_generic.h +93 -0
  627. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/string/operations_generic.h +201 -0
  628. hyperdrone/_vendor/rl-tools/include/rl_tools/utils/zlib/operations_cpu.h +45 -0
  629. hyperdrone/_vendor/rl-tools/include/rl_tools/version.h +28 -0
  630. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/CMakeLists.txt +15 -0
  631. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/README.md +193 -0
  632. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/CMakeLists.txt +11 -0
  633. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/CMakeLists.txt +17 -0
  634. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/freestanding_check.cpp +135 -0
  635. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/CMakeLists.txt +31 -0
  636. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/device.metal +953 -0
  637. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/metal_cpp_impl.cpp +6 -0
  638. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/CMakeLists.txt +51 -0
  639. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/device.cu +1 -0
  640. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/overlay_accel.cu +311 -0
  641. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/CMakeLists.txt +37 -0
  642. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device.comp +1013 -0
  643. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device_spirv.cpp +44 -0
  644. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/webgpu/CMakeLists.txt +31 -0
  645. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/webgpu/device.wgsl +1448 -0
  646. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/CMakeLists.txt +110 -0
  647. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/README.md +55 -0
  648. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark.cpp +180 -0
  649. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark_dynamic.cpp +491 -0
  650. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/rig.cpp +119 -0
  651. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix.cpp +1130 -0
  652. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_config.h.in +13 -0
  653. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/camera_orbit.h +51 -0
  654. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/CMakeLists.txt +199 -0
  655. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/antialiasing.cpp +214 -0
  656. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone.cpp +320 -0
  657. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone_device.cu +359 -0
  658. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/environment.h +96 -0
  659. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/operations_cpu.h +263 -0
  660. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/example.cpp +273 -0
  661. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/fixed_pose.cpp +221 -0
  662. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/flow.cpp +120 -0
  663. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/interactive.cpp +1015 -0
  664. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/make_drone_glb.py +172 -0
  665. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/minimal.cpp +82 -0
  666. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/minimal_overlay.cpp +137 -0
  667. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/motion_blur.cpp +232 -0
  668. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace.cpp +1829 -0
  669. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace_motion_blur.cpp +647 -0
  670. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/web/assimp/CMakeLists.txt +8 -0
  671. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/web/build.sh +80 -0
  672. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/web/drone_web.cpp +234 -0
  673. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/CMakeLists.txt +147 -0
  674. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/README.md +15 -0
  675. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/job.sbatch +28 -0
  676. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model.h +260 -0
  677. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_config.h +24 -0
  678. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_forward_cuda.h +397 -0
  679. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_operations.h +418 -0
  680. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_persist.h +45 -0
  681. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_student.h +70 -0
  682. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.cpp +222 -0
  683. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.h +68 -0
  684. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.gitignore +4 -0
  685. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/CMakeLists.txt +4 -0
  686. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info.plist +24 -0
  687. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info_ios.plist +36 -0
  688. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/CameraManager.swift +120 -0
  689. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/ContentView.swift +703 -0
  690. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/DatasetRecorder.swift +285 -0
  691. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/YawPredictorApp.swift +25 -0
  692. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/YawPredictor.entitlements +8 -0
  693. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build.sh +66 -0
  694. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build_ios.sh +133 -0
  695. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/generate.sh +6 -0
  696. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/h5_to_tar.cpp +82 -0
  697. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.cpp +166 -0
  698. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.h +26 -0
  699. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/project.yml +30 -0
  700. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/test_tar_vs_hdf5.cpp +173 -0
  701. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_cuda.cu +699 -0
  702. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_dataset_overlay.cpp +475 -0
  703. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_distill_cuda.cu +995 -0
  704. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_eval.cu +457 -0
  705. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_real_world_eval.cpp +660 -0
  706. hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_viewer.cu +443 -0
  707. hyperdrone/cuda/__init__.py +78 -0
  708. hyperdrone/dynamics/__init__.py +22 -0
  709. hyperdrone/dynamics/_component.py +35 -0
  710. hyperdrone/dynamics/_config.py +48 -0
  711. hyperdrone/dynamics/_sim.py +195 -0
  712. hyperdrone/env/__init__.py +17 -0
  713. hyperdrone/env/_multi_environment.py +407 -0
  714. hyperdrone/env/_rotorcraft.py +31 -0
  715. hyperdrone/examples/.gitignore +2 -0
  716. hyperdrone/examples/Benchmark.ipynb +102 -0
  717. hyperdrone/examples/HyperDrone.ipynb +514 -0
  718. hyperdrone/examples/Orbiter.ipynb +462 -0
  719. hyperdrone/examples/Renderer.ipynb +173 -0
  720. hyperdrone/examples/__init__.py +16 -0
  721. hyperdrone/examples/articulation.py +55 -0
  722. hyperdrone/examples/benchmark.py +236 -0
  723. hyperdrone/examples/benchmark_minimal.py +65 -0
  724. hyperdrone/examples/data.py +70 -0
  725. hyperdrone/examples/drone_flythrough.py +169 -0
  726. hyperdrone/examples/hyperdrone_videos/my_world_preview.h +17 -0
  727. hyperdrone/examples/my_world.h +17 -0
  728. hyperdrone/examples/render_procthor.py +41 -0
  729. hyperdrone/examples/visual_inertial_localization.py +159 -0
  730. hyperdrone/gym/__init__.py +63 -0
  731. hyperdrone/jit/__init__.py +129 -0
  732. hyperdrone/jit/_build.py +113 -0
  733. hyperdrone/jit/_lock.py +23 -0
  734. hyperdrone/jit/_patches.py +99 -0
  735. hyperdrone/jit/_toolchain.py +17 -0
  736. hyperdrone/jit/_workspace.py +68 -0
  737. hyperdrone/render/__init__.py +53 -0
  738. hyperdrone/render/_component.py +51 -0
  739. hyperdrone/render/_config.py +92 -0
  740. hyperdrone/render/_renderer.py +447 -0
  741. hyperdrone/render/_rig.py +136 -0
  742. hyperdrone/render/_sampling.py +69 -0
  743. hyperdrone/render/_scene.py +36 -0
  744. hyperverse-0.0.1.dist-info/METADATA +370 -0
  745. hyperverse-0.0.1.dist-info/RECORD +746 -0
  746. hyperverse-0.0.1.dist-info/WHEEL +4 -0
@@ -0,0 +1,623 @@
1
+ #include "../../version.h"
2
+ #if (defined(RL_TOOLS_DISABLE_INCLUDE_GUARDS) || !defined(RL_TOOLS_NN_MODELS_PARALLEL_OPERATIONS_GENERIC_H)) && (RL_TOOLS_USE_THIS_VERSION == 1)
3
+ #pragma once
4
+ #define RL_TOOLS_NN_MODELS_PARALLEL_OPERATIONS_GENERIC_H
5
+
6
+ #include "model.h"
7
+ #include "../sequential/operations_generic.h"
8
+
9
+ RL_TOOLS_NAMESPACE_WRAPPER_START
10
+ namespace rl_tools{
11
+ namespace nn_models::parallel{
12
+ namespace detail{
13
+ template <typename TI>
14
+ RL_TOOLS_FUNCTION_PLACEMENT void _fill_tuple(utils::Tuple<TI>&){}
15
+ template <typename TI, typename HEAD, typename... TAIL, typename FIRST, typename... REST>
16
+ RL_TOOLS_FUNCTION_PLACEMENT void _fill_tuple(utils::Tuple<TI, HEAD, TAIL...>& tuple, const FIRST& first, const REST&... rest){
17
+ tuple.content = first;
18
+ _fill_tuple(static_cast<utils::Tuple<TI, TAIL...>&>(tuple), rest...);
19
+ }
20
+ }
21
+
22
+ template <typename FIRST, typename... REST>
23
+ RL_TOOLS_FUNCTION_PLACEMENT utils::Tuple<typename FIRST::SPEC::SHAPE::TI, FIRST, REST...> pack_inputs(const FIRST& first, const REST&... rest){
24
+ using TI = typename FIRST::SPEC::SHAPE::TI;
25
+ utils::Tuple<TI, FIRST, REST...> result{};
26
+ detail::_fill_tuple(result, first, rest...);
27
+ return result;
28
+ }
29
+
30
+ // 2-tensor concatenation (convenience for custom models that manage their own buffers)
31
+ template <typename DEVICE, typename A_SPEC, typename B_SPEC, typename OUTPUT_SPEC>
32
+ RL_TOOLS_FUNCTION_PLACEMENT void _concatenate(DEVICE& device, const Tensor<A_SPEC>& a, const Tensor<B_SPEC>& b, Tensor<OUTPUT_SPEC>& output){
33
+ using TI = typename DEVICE::index_t;
34
+ using A_SHAPE = typename A_SPEC::SHAPE;
35
+ using B_SHAPE = typename B_SPEC::SHAPE;
36
+ using OUT_SHAPE = typename OUTPUT_SPEC::SHAPE;
37
+ constexpr TI LAST_DIM_A = get_last(A_SHAPE{});
38
+ constexpr TI LAST_DIM_B = get_last(B_SHAPE{});
39
+ constexpr TI LAST_DIM_OUT = get_last(OUT_SHAPE{});
40
+ static_assert(LAST_DIM_OUT == LAST_DIM_A + LAST_DIM_B);
41
+ constexpr TI TOTAL_A = product(A_SHAPE{});
42
+ constexpr TI LEADING = TOTAL_A / LAST_DIM_A;
43
+ for(TI i = 0; i < LEADING; i++){
44
+ for(TI j = 0; j < LAST_DIM_A; j++){
45
+ *(data(output) + i * LAST_DIM_OUT + j) = get_flat(device, a, i * LAST_DIM_A + j);
46
+ }
47
+ for(TI j = 0; j < LAST_DIM_B; j++){
48
+ *(data(output) + i * LAST_DIM_OUT + LAST_DIM_A + j) = get_flat(device, b, i * LAST_DIM_B + j);
49
+ }
50
+ }
51
+ }
52
+
53
+ template <typename DEVICE, typename D_OUTPUT_SPEC, typename D_A_SPEC, typename D_B_SPEC>
54
+ RL_TOOLS_FUNCTION_PLACEMENT void _split(DEVICE& device, const Tensor<D_OUTPUT_SPEC>& d_output, Tensor<D_A_SPEC>& d_a, Tensor<D_B_SPEC>& d_b){
55
+ using TI = typename DEVICE::index_t;
56
+ using A_SHAPE = typename D_A_SPEC::SHAPE;
57
+ using B_SHAPE = typename D_B_SPEC::SHAPE;
58
+ using OUT_SHAPE = typename D_OUTPUT_SPEC::SHAPE;
59
+ constexpr TI LAST_DIM_A = get_last(A_SHAPE{});
60
+ constexpr TI LAST_DIM_B = get_last(B_SHAPE{});
61
+ constexpr TI LAST_DIM_OUT = get_last(OUT_SHAPE{});
62
+ static_assert(LAST_DIM_OUT == LAST_DIM_A + LAST_DIM_B);
63
+ constexpr TI TOTAL_A = product(A_SHAPE{});
64
+ constexpr TI LEADING = TOTAL_A / LAST_DIM_A;
65
+ for(TI i = 0; i < LEADING; i++){
66
+ for(TI j = 0; j < LAST_DIM_A; j++){
67
+ *(data(d_a) + i * LAST_DIM_A + j) = get_flat(device, d_output, i * LAST_DIM_OUT + j);
68
+ }
69
+ for(TI j = 0; j < LAST_DIM_B; j++){
70
+ *(data(d_b) + i * LAST_DIM_B + j) = get_flat(device, d_output, i * LAST_DIM_OUT + LAST_DIM_A + j);
71
+ }
72
+ }
73
+ }
74
+
75
+ template <auto NUM_BRANCHES, auto I = 0, auto OFFSET = 0, typename DEVICE, typename INTERMEDIATES, typename OUTPUT_SPEC>
76
+ RL_TOOLS_FUNCTION_PLACEMENT void _concatenate_n(DEVICE& device, const INTERMEDIATES& intermediates, Tensor<OUTPUT_SPEC>& output){
77
+ if constexpr(I < NUM_BRANCHES){
78
+ using TI = typename DEVICE::index_t;
79
+ using OUTPUT_SHAPE = typename OUTPUT_SPEC::SHAPE;
80
+ constexpr TI LAST_DIM_OUT = get_last(OUTPUT_SHAPE{});
81
+ constexpr TI LEADING = product(OUTPUT_SHAPE{}) / LAST_DIM_OUT;
82
+ const auto& src = get<I>(intermediates);
83
+ using SRC_SHAPE = typename utils::typing::remove_reference_t<decltype(src)>::SPEC::SHAPE;
84
+ constexpr TI DIM_I = get_last(SRC_SHAPE{});
85
+ for(TI i = 0; i < LEADING; i++){
86
+ for(TI j = 0; j < DIM_I; j++){
87
+ TI src_idx = i * DIM_I + j;
88
+ TI out_idx = i * LAST_DIM_OUT + (TI)OFFSET + j;
89
+ *(data(output) + out_idx) = get_flat(device, src, src_idx);
90
+ }
91
+ }
92
+ _concatenate_n<NUM_BRANCHES, I + 1, OFFSET + DIM_I>(device, intermediates, output);
93
+ }
94
+ }
95
+
96
+ // N-way split: extract each branch's gradient from the concatenated gradient
97
+ template <auto NUM_BRANCHES, auto I = 0, auto OFFSET = 0, typename DEVICE, typename D_OUTPUT_SPEC, typename D_OUTPUTS>
98
+ RL_TOOLS_FUNCTION_PLACEMENT void _split_n(DEVICE& device, const Tensor<D_OUTPUT_SPEC>& d_output, D_OUTPUTS& d_outputs){
99
+ if constexpr(I < NUM_BRANCHES){
100
+ using TI = typename DEVICE::index_t;
101
+ using D_OUTPUT_SHAPE = typename D_OUTPUT_SPEC::SHAPE;
102
+ constexpr TI LAST_DIM_OUT = get_last(D_OUTPUT_SHAPE{});
103
+ auto& dst = get<I>(d_outputs);
104
+ using DST_SHAPE = typename utils::typing::remove_reference_t<decltype(dst)>::SPEC::SHAPE;
105
+ constexpr TI DIM_I = get_last(DST_SHAPE{});
106
+ constexpr TI TOTAL_DST = product(DST_SHAPE{});
107
+ constexpr TI LEADING = TOTAL_DST / DIM_I;
108
+ for(TI i = 0; i < LEADING; i++){
109
+ for(TI j = 0; j < DIM_I; j++){
110
+ TI out_idx = i * LAST_DIM_OUT + (TI)OFFSET + j;
111
+ TI dst_idx = i * DIM_I + j;
112
+ *(data(dst) + dst_idx) = get_flat(device, d_output, out_idx);
113
+ }
114
+ }
115
+ _split_n<NUM_BRANCHES, I + 1, OFFSET + DIM_I>(device, d_output, d_outputs);
116
+ }
117
+ }
118
+
119
+ // Branch iteration helpers
120
+ template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename RNG, typename MODE>
121
+ RL_TOOLS_FUNCTION_PLACEMENT void _evaluate_branches(DEVICE& device, const ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode){
122
+ if constexpr(I < SPEC::NUM_BRANCHES){
123
+ evaluate(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.intermediates), get<I>(buffer.sub_buffers), rng, mode);
124
+ _evaluate_branches<I + 1>(device, model, inputs, buffer, rng, mode);
125
+ }
126
+ }
127
+
128
+ template <auto I = 0, auto OFFSET = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename STATE_SPEC, typename CONCAT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE>
129
+ RL_TOOLS_FUNCTION_PLACEMENT void _evaluate_step_branches(DEVICE& device, const ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, ModuleState<STATE_SPEC>& state, Tensor<CONCAT_SPEC>& concatenated, ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode){
130
+ if constexpr(I < SPEC::NUM_BRANCHES){
131
+ using TI = typename DEVICE::index_t;
132
+ using INTERMEDIATE_SHAPE = typename utils::typing::remove_reference_t<decltype(get<I>(buffer.intermediates))>::SPEC::SHAPE;
133
+ constexpr TI DIM_I = get_last(INTERMEDIATE_SHAPE{});
134
+ auto output_view = view_range(device, concatenated, (TI)OFFSET, tensor::ViewSpec<1, DIM_I>{});
135
+ evaluate_step(device, get<I>(model.pipelines), get<I>(inputs), get<I>(state.states), output_view, get<I>(buffer.sub_buffers), rng, mode);
136
+ _evaluate_step_branches<I + 1, OFFSET + DIM_I>(device, model, inputs, state, concatenated, buffer, rng, mode);
137
+ }
138
+ }
139
+
140
+ template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename RNG, typename MODE>
141
+ RL_TOOLS_FUNCTION_PLACEMENT void _forward_branches(DEVICE& device, ModuleGradient<SPEC>& model, INPUT_TUPLE& inputs, ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode){
142
+ if constexpr(I < SPEC::NUM_BRANCHES){
143
+ forward(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.sub_buffers), rng, mode);
144
+ auto output_i = rl_tools::output(device, get<I>(model.pipelines));
145
+ copy(device, device, output_i, get<I>(buffer.intermediates));
146
+ _forward_branches<I + 1>(device, model, inputs, buffer, rng, mode);
147
+ }
148
+ }
149
+
150
+ template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE>
151
+ RL_TOOLS_FUNCTION_PLACEMENT void _backward_full_branches(DEVICE& device, ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, D_INPUT_TUPLE& d_inputs, ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode){
152
+ if constexpr(I < SPEC::NUM_BRANCHES){
153
+ _backward_full_selected(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.d_outputs), get<I>(d_inputs), get<I>(buffer.sub_buffers), mode);
154
+ _backward_full_branches<I + 1>(device, model, inputs, d_inputs, buffer, mode);
155
+ }
156
+ }
157
+
158
+ template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename MODE>
159
+ RL_TOOLS_FUNCTION_PLACEMENT void _backward_branches(DEVICE& device, ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode){
160
+ if constexpr(I < SPEC::NUM_BRANCHES){
161
+ using PIPELINE = utils::typing::remove_reference_t<decltype(get<I>(model.pipelines))>;
162
+ if constexpr(nn_models::backpropagation::ParameterGradients<typename PIPELINE::SPEC, MODE>::VALUE){
163
+ backward(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.d_outputs), get<I>(buffer.sub_buffers), mode);
164
+ }
165
+ _backward_branches<I + 1>(device, model, inputs, buffer, mode);
166
+ }
167
+ }
168
+
169
+ template <auto I = 0, typename DEVICE, typename SPEC, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE>
170
+ RL_TOOLS_FUNCTION_PLACEMENT void _backward_input_branches(DEVICE& device, ModuleBackward<SPEC>& model, D_INPUT_TUPLE& d_inputs, ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode){
171
+ if constexpr(I < SPEC::NUM_BRANCHES){
172
+ backward_input(device, get<I>(model.pipelines), get<I>(buffer.d_outputs), get<I>(d_inputs), get<I>(buffer.sub_buffers), mode);
173
+ _backward_input_branches<I + 1>(device, model, d_inputs, buffer, mode);
174
+ }
175
+ }
176
+
177
+ template <auto I = 0, typename DEVICE, typename SPEC>
178
+ RL_TOOLS_FUNCTION_PLACEMENT void _malloc_pipelines(DEVICE& device, ModuleForward<SPEC>& model){
179
+ if constexpr(I < SPEC::NUM_BRANCHES){
180
+ malloc(device, get<I>(model.pipelines));
181
+ _malloc_pipelines<I + 1>(device, model);
182
+ }
183
+ }
184
+ template <auto I = 0, typename DEVICE, typename SPEC>
185
+ RL_TOOLS_FUNCTION_PLACEMENT void _free_pipelines(DEVICE& device, ModuleForward<SPEC>& model){
186
+ if constexpr(I < SPEC::NUM_BRANCHES){
187
+ free(device, get<I>(model.pipelines));
188
+ _free_pipelines<I + 1>(device, model);
189
+ }
190
+ }
191
+ template <auto I = 0, typename DEVICE, typename BUFFER_SPEC>
192
+ RL_TOOLS_FUNCTION_PLACEMENT void _malloc_buffer_tuples(DEVICE& device, ModuleBuffer<BUFFER_SPEC>& buffer){
193
+ if constexpr(I < BUFFER_SPEC::SPEC::NUM_BRANCHES){
194
+ malloc(device, get<I>(buffer.sub_buffers));
195
+ malloc(device, get<I>(buffer.intermediates));
196
+ malloc(device, get<I>(buffer.d_outputs));
197
+ _malloc_buffer_tuples<I + 1>(device, buffer);
198
+ }
199
+ }
200
+ template <auto I = 0, typename DEVICE, typename BUFFER_SPEC>
201
+ RL_TOOLS_FUNCTION_PLACEMENT void _free_buffer_tuples(DEVICE& device, ModuleBuffer<BUFFER_SPEC>& buffer){
202
+ if constexpr(I < BUFFER_SPEC::SPEC::NUM_BRANCHES){
203
+ free(device, get<I>(buffer.sub_buffers));
204
+ free(device, get<I>(buffer.intermediates));
205
+ free(device, get<I>(buffer.d_outputs));
206
+ _free_buffer_tuples<I + 1>(device, buffer);
207
+ }
208
+ }
209
+ template <auto I = 0, typename DEVICE, typename STATE_SPEC>
210
+ RL_TOOLS_FUNCTION_PLACEMENT void _malloc_states(DEVICE& device, ModuleState<STATE_SPEC>& state){
211
+ if constexpr(I < STATE_SPEC::SPEC::NUM_BRANCHES){
212
+ malloc(device, get<I>(state.states));
213
+ _malloc_states<I + 1>(device, state);
214
+ }
215
+ }
216
+ template <auto I = 0, typename DEVICE, typename STATE_SPEC>
217
+ RL_TOOLS_FUNCTION_PLACEMENT void _free_states(DEVICE& device, ModuleState<STATE_SPEC>& state){
218
+ if constexpr(I < STATE_SPEC::SPEC::NUM_BRANCHES){
219
+ free(device, get<I>(state.states));
220
+ _free_states<I + 1>(device, state);
221
+ }
222
+ }
223
+
224
+ template <auto I = 0, typename DEVICE, typename SPEC, typename RNG>
225
+ RL_TOOLS_FUNCTION_PLACEMENT void _init_weights_branches(DEVICE& device, ModuleForward<SPEC>& model, RNG& rng){
226
+ if constexpr(I < SPEC::NUM_BRANCHES){
227
+ init_weights(device, get<I>(model.pipelines), rng);
228
+ _init_weights_branches<I + 1>(device, model, rng);
229
+ }
230
+ }
231
+
232
+ template <auto I = 0, typename DEVICE, typename SPEC, typename STATE_SPEC, typename RNG, typename MODE>
233
+ RL_TOOLS_FUNCTION_PLACEMENT void _reset_branches(DEVICE& device, const ModuleForward<SPEC>& model, ModuleState<STATE_SPEC>& state, RNG& rng, const Mode<MODE>& mode){
234
+ if constexpr(I < SPEC::NUM_BRANCHES){
235
+ reset(device, get<I>(model.pipelines), get<I>(state.states), rng, mode);
236
+ _reset_branches<I + 1>(device, model, state, rng, mode);
237
+ }
238
+ }
239
+
240
+ template <auto I = 0, typename DEVICE, typename SPEC>
241
+ RL_TOOLS_FUNCTION_PLACEMENT void _zero_gradient_branches(DEVICE& device, ModuleGradient<SPEC>& model){
242
+ if constexpr(I < SPEC::NUM_BRANCHES){
243
+ zero_gradient(device, get<I>(model.pipelines));
244
+ _zero_gradient_branches<I + 1>(device, model);
245
+ }
246
+ }
247
+ template <auto I = 0, typename DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
248
+ RL_TOOLS_FUNCTION_PLACEMENT void _add_gradient_branches(DEVICE& device, ModuleGradient<SOURCE_SPEC>& source, ModuleGradient<TARGET_SPEC>& target){
249
+ if constexpr(I < SOURCE_SPEC::NUM_BRANCHES){
250
+ add_gradient(device, get<I>(source.pipelines), get<I>(target.pipelines));
251
+ _add_gradient_branches<I + 1>(device, source, target);
252
+ }
253
+ }
254
+ template <auto I = 0, typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
255
+ RL_TOOLS_FUNCTION_PLACEMENT void _copy_gradient_branches(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const ModuleGradient<SOURCE_SPEC>& source, ModuleGradient<TARGET_SPEC>& target){
256
+ if constexpr(I < SOURCE_SPEC::NUM_BRANCHES){
257
+ copy_gradient(source_device, target_device, get<I>(source.pipelines), get<I>(target.pipelines));
258
+ _copy_gradient_branches<I + 1>(source_device, target_device, source, target);
259
+ }
260
+ }
261
+
262
+ template <auto I = 0, typename DEVICE, typename SPEC, typename OPTIMIZER>
263
+ RL_TOOLS_FUNCTION_PLACEMENT void _update_branches(DEVICE& device, ModuleGradient<SPEC>& model, OPTIMIZER& optimizer){
264
+ if constexpr(I < SPEC::NUM_BRANCHES){
265
+ update(device, get<I>(model.pipelines), optimizer);
266
+ _update_branches<I + 1>(device, model, optimizer);
267
+ }
268
+ }
269
+
270
+ template <auto I = 0, typename DEVICE, typename SPEC, typename OPTIMIZER>
271
+ RL_TOOLS_FUNCTION_PLACEMENT void _reset_optimizer_state_branches(DEVICE& device, ModuleGradient<SPEC>& model, OPTIMIZER& optimizer){
272
+ if constexpr(I < SPEC::NUM_BRANCHES){
273
+ _reset_optimizer_state(device, get<I>(model.pipelines), optimizer);
274
+ _reset_optimizer_state_branches<I + 1>(device, model, optimizer);
275
+ }
276
+ }
277
+
278
+ template <auto I = 0, typename DEVICE, typename SPEC>
279
+ RL_TOOLS_FUNCTION_PLACEMENT void _reset_forward_state_branches(DEVICE& device, ModuleForward<SPEC>& model){
280
+ if constexpr(I < SPEC::NUM_BRANCHES){
281
+ reset_forward_state(device, get<I>(model.pipelines));
282
+ _reset_forward_state_branches<I + 1>(device, model);
283
+ }
284
+ }
285
+
286
+ template <auto I = 0, typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
287
+ RL_TOOLS_FUNCTION_PLACEMENT void _copy_branches(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const ModuleForward<SOURCE_SPEC>& source, ModuleForward<TARGET_SPEC>& target){
288
+ if constexpr(I < SOURCE_SPEC::NUM_BRANCHES){
289
+ copy(source_device, target_device, get<I>(source.pipelines), get<I>(target.pipelines));
290
+ _copy_branches<I + 1>(source_device, target_device, source, target);
291
+ }
292
+ }
293
+
294
+ template <auto I = 0, typename DEVICE, typename SPEC_A, typename SPEC_B>
295
+ RL_TOOLS_FUNCTION_PLACEMENT typename SPEC_A::TYPE_POLICY::DEFAULT _abs_diff_branches(DEVICE& device, ModuleForward<SPEC_A>& a, const ModuleForward<SPEC_B>& b){
296
+ using T = typename SPEC_A::TYPE_POLICY::DEFAULT;
297
+ if constexpr(I < SPEC_A::NUM_BRANCHES){
298
+ return static_cast<T>(abs_diff(device, get<I>(a.pipelines), get<I>(b.pipelines))) + _abs_diff_branches<I + 1>(device, a, b);
299
+ }
300
+ else{
301
+ return static_cast<T>(0);
302
+ }
303
+ }
304
+
305
+ template <auto I = 0, typename DEVICE, typename SPEC, typename MODE>
306
+ RL_TOOLS_FUNCTION_PLACEMENT bool _is_nan_branches(DEVICE& device, ModuleForward<SPEC>& model, const Mode<MODE>& mode){
307
+ if constexpr(I < SPEC::NUM_BRANCHES){
308
+ return is_nan(device, get<I>(model.pipelines), mode) || _is_nan_branches<I + 1>(device, model, mode);
309
+ }
310
+ else{
311
+ return false;
312
+ }
313
+ }
314
+ }
315
+
316
+ // ======================== malloc / free ========================
317
+ template <typename DEVICE, typename SPEC>
318
+ RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module){
319
+ nn_models::parallel::_malloc_pipelines(device, module);
320
+ if constexpr(SPEC::HAS_HEAD){
321
+ malloc(device, module.head);
322
+ }
323
+ }
324
+ template <typename DEVICE, typename SPEC>
325
+ RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module){
326
+ nn_models::parallel::_free_pipelines(device, module);
327
+ if constexpr(SPEC::HAS_HEAD){
328
+ free(device, module.head);
329
+ }
330
+ }
331
+ template <typename DEVICE, typename SPEC>
332
+ RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleBackward<SPEC>& module){
333
+ malloc(device, static_cast<nn_models::parallel::ModuleForward<SPEC>&>(module));
334
+ }
335
+ template <typename DEVICE, typename SPEC>
336
+ RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleBackward<SPEC>& module){
337
+ free(device, static_cast<nn_models::parallel::ModuleForward<SPEC>&>(module));
338
+ }
339
+ template <typename DEVICE, typename SPEC>
340
+ RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module){
341
+ malloc(device, static_cast<nn_models::parallel::ModuleBackward<SPEC>&>(module));
342
+ malloc(device, module.output);
343
+ }
344
+ template <typename DEVICE, typename SPEC>
345
+ RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module){
346
+ free(device, static_cast<nn_models::parallel::ModuleBackward<SPEC>&>(module));
347
+ free(device, module.output);
348
+ }
349
+
350
+ template <typename DEVICE, typename BUFFER_SPEC>
351
+ RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer){
352
+ using SPEC = typename BUFFER_SPEC::SPEC;
353
+ nn_models::parallel::_malloc_buffer_tuples(device, buffer);
354
+ malloc(device, buffer.concatenated);
355
+ malloc(device, buffer.d_concatenated);
356
+ if constexpr(SPEC::HAS_HEAD){
357
+ malloc(device, buffer.head_buffer);
358
+ }
359
+ }
360
+ template <typename DEVICE, typename BUFFER_SPEC>
361
+ RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer){
362
+ using SPEC = typename BUFFER_SPEC::SPEC;
363
+ nn_models::parallel::_free_buffer_tuples(device, buffer);
364
+ free(device, buffer.concatenated);
365
+ free(device, buffer.d_concatenated);
366
+ if constexpr(SPEC::HAS_HEAD){
367
+ free(device, buffer.head_buffer);
368
+ }
369
+ }
370
+
371
+ template <typename DEVICE, typename STATE_SPEC>
372
+ RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleState<STATE_SPEC>& state){
373
+ using SPEC = typename STATE_SPEC::SPEC;
374
+ nn_models::parallel::_malloc_states(device, state);
375
+ if constexpr(SPEC::HAS_HEAD){
376
+ malloc(device, state.head_state);
377
+ }
378
+ }
379
+ template <typename DEVICE, typename STATE_SPEC>
380
+ RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleState<STATE_SPEC>& state){
381
+ using SPEC = typename STATE_SPEC::SPEC;
382
+ nn_models::parallel::_free_states(device, state);
383
+ if constexpr(SPEC::HAS_HEAD){
384
+ free(device, state.head_state);
385
+ }
386
+ }
387
+
388
+ // ======================== init_weights ========================
389
+ template <typename DEVICE, typename SPEC, typename RNG>
390
+ RL_TOOLS_FUNCTION_PLACEMENT void init_weights(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module, RNG& rng){
391
+ nn_models::parallel::_init_weights_branches(device, module, rng);
392
+ if constexpr(SPEC::HAS_HEAD){
393
+ init_weights(device, module.head, rng);
394
+ }
395
+ }
396
+
397
+ // ======================== reset ========================
398
+ template <typename DEVICE, typename SPEC, typename STATE_SPEC, typename RNG, typename MODE = mode::Default<>>
399
+ RL_TOOLS_FUNCTION_PLACEMENT void reset(DEVICE& device, const nn_models::parallel::ModuleForward<SPEC>& model, nn_models::parallel::ModuleState<STATE_SPEC>& state, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
400
+ nn_models::parallel::_reset_branches(device, model, state, rng, mode);
401
+ if constexpr(SPEC::HAS_HEAD){
402
+ reset(device, model.head, state.head_state, rng, mode);
403
+ }
404
+ }
405
+
406
+ // ======================== evaluate_step ========================
407
+ template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename STATE_SPEC, typename OUTPUT, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
408
+ RL_TOOLS_FUNCTION_PLACEMENT void evaluate_step(DEVICE& device, const nn_models::parallel::ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, nn_models::parallel::ModuleState<STATE_SPEC>& state, OUTPUT& output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
409
+ using TI = typename SPEC::TI;
410
+ using OUTPUT_SHAPE = typename OUTPUT::SPEC::SHAPE;
411
+ using CONCAT_BUFFER_SHAPE = typename utils::typing::remove_reference_t<decltype(buffer.concatenated)>::SPEC::SHAPE;
412
+ constexpr TI CONCAT_LAST_DIM = get_last(CONCAT_BUFFER_SHAPE{});
413
+ using CONCAT_VIEW_SHAPE = tensor::Replace<OUTPUT_SHAPE, CONCAT_LAST_DIM, length(OUTPUT_SHAPE{}) - 1>;
414
+ auto concat_view = view_memory<CONCAT_VIEW_SHAPE>(device, buffer.concatenated);
415
+ nn_models::parallel::_evaluate_step_branches(device, model, inputs, state, concat_view, buffer, rng, mode);
416
+ if constexpr(SPEC::HAS_HEAD){
417
+ evaluate_step(device, model.head, concat_view, state.head_state, output, buffer.head_buffer, rng, mode);
418
+ }
419
+ else{
420
+ copy(device, device, concat_view, output);
421
+ }
422
+ }
423
+
424
+ // ======================== evaluate ========================
425
+ template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename OUTPUT, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
426
+ RL_TOOLS_FUNCTION_PLACEMENT void evaluate(DEVICE& device, const nn_models::parallel::ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, OUTPUT& output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
427
+ nn_models::parallel::_evaluate_branches(device, model, inputs, buffer, rng, mode);
428
+ nn_models::parallel::_concatenate_n<SPEC::NUM_BRANCHES>(device, buffer.intermediates, buffer.concatenated);
429
+ if constexpr(SPEC::HAS_HEAD){
430
+ evaluate(device, model.head, buffer.concatenated, output, buffer.head_buffer, rng, mode);
431
+ }
432
+ else{
433
+ copy(device, device, buffer.concatenated, output);
434
+ }
435
+ }
436
+
437
+ // ======================== forward ========================
438
+ template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
439
+ RL_TOOLS_FUNCTION_PLACEMENT void forward(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, INPUT_TUPLE& inputs, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
440
+ nn_models::parallel::_forward_branches(device, model, inputs, buffer, rng, mode);
441
+ nn_models::parallel::_concatenate_n<SPEC::NUM_BRANCHES>(device, buffer.intermediates, buffer.concatenated);
442
+ if constexpr(SPEC::HAS_HEAD){
443
+ forward(device, model.head, buffer.concatenated, buffer.head_buffer, rng, mode);
444
+ auto head_output = rl_tools::output(device, model.head);
445
+ copy(device, device, head_output, model.output);
446
+ }
447
+ else{
448
+ copy(device, device, buffer.concatenated, model.output);
449
+ }
450
+ }
451
+
452
+ template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename OUTPUT, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
453
+ RL_TOOLS_FUNCTION_PLACEMENT void forward(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, INPUT_TUPLE& inputs, OUTPUT& output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
454
+ forward(device, model, inputs, buffer, rng, mode);
455
+ copy(device, device, model.output, output);
456
+ }
457
+
458
+ // ======================== backward_full ========================
459
+ template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename D_OUTPUT, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
460
+ RL_TOOLS_FUNCTION_PLACEMENT void backward_full(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, D_OUTPUT& d_output, D_INPUT_TUPLE& d_inputs, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
461
+ if constexpr(SPEC::HAS_HEAD){
462
+ _backward_full_selected(device, model.head, buffer.concatenated, d_output, buffer.d_concatenated, buffer.head_buffer, mode);
463
+ nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, buffer.d_concatenated, buffer.d_outputs);
464
+ }
465
+ else{
466
+ nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, d_output, buffer.d_outputs);
467
+ }
468
+ nn_models::parallel::_backward_full_branches(device, model, inputs, d_inputs, buffer, mode);
469
+ }
470
+
471
+ // ======================== backward (gradients only) ========================
472
+ template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename D_OUTPUT, typename BUFFER_SPEC, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
473
+ RL_TOOLS_FUNCTION_PLACEMENT void backward(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, D_OUTPUT& d_output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
474
+ if constexpr(nn_models::backpropagation::ParameterGradientsTuple<typename SPEC::PIPELINES_TYPE, MODE>::VALUE){
475
+ if constexpr(SPEC::HAS_HEAD){
476
+ _backward_full_selected(device, model.head, buffer.concatenated, d_output, buffer.d_concatenated, buffer.head_buffer, mode);
477
+ nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, buffer.d_concatenated, buffer.d_outputs);
478
+ }
479
+ else{
480
+ nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, d_output, buffer.d_outputs);
481
+ }
482
+ nn_models::parallel::_backward_branches(device, model, inputs, buffer, mode);
483
+ }
484
+ else if constexpr(nn_models::backpropagation::HeadParameterGradients<SPEC, MODE>::VALUE){
485
+ backward(device, model.head, buffer.concatenated, d_output, buffer.head_buffer, mode);
486
+ }
487
+ }
488
+
489
+ template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename D_OUTPUT, typename D_FEATURE_SPEC, typename BUFFER_SPEC, typename MODE = mode::Default<>>
490
+ RL_TOOLS_FUNCTION_PLACEMENT void backward(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, D_OUTPUT& d_output, Tensor<D_FEATURE_SPEC>& additional_feature_gradient, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
491
+ static_assert(SPEC::HAS_HEAD, "Additional feature gradients require a parallel model with a head");
492
+ if constexpr(nn_models::backpropagation::ParameterGradientsTuple<typename SPEC::PIPELINES_TYPE, MODE>::VALUE){
493
+ _backward_full_selected(device, model.head, buffer.concatenated, d_output, buffer.d_concatenated, buffer.head_buffer, mode);
494
+ add(device, additional_feature_gradient, buffer.d_concatenated);
495
+ nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, buffer.d_concatenated, buffer.d_outputs);
496
+ nn_models::parallel::_backward_branches(device, model, inputs, buffer, mode);
497
+ }
498
+ else if constexpr(nn_models::backpropagation::HeadParameterGradients<SPEC, MODE>::VALUE){
499
+ backward(device, model.head, buffer.concatenated, d_output, buffer.head_buffer, mode);
500
+ }
501
+ }
502
+
503
+ // ======================== backward_input ========================
504
+ template <typename DEVICE, typename SPEC, typename D_OUTPUT, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE = mode::Default<>>
505
+ RL_TOOLS_FUNCTION_PLACEMENT void backward_input(DEVICE& device, nn_models::parallel::ModuleBackward<SPEC>& model, D_OUTPUT& d_output, D_INPUT_TUPLE& d_inputs, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
506
+ if constexpr(SPEC::HAS_HEAD){
507
+ backward_input(device, model.head, d_output, buffer.d_concatenated, buffer.head_buffer, mode);
508
+ nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, buffer.d_concatenated, buffer.d_outputs);
509
+ }
510
+ else{
511
+ nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, d_output, buffer.d_outputs);
512
+ }
513
+ nn_models::parallel::_backward_input_branches(device, model, d_inputs, buffer, mode);
514
+ }
515
+
516
+ // ======================== zero_gradient ========================
517
+ template <typename DEVICE, typename SPEC>
518
+ RL_TOOLS_FUNCTION_PLACEMENT void zero_gradient(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module){
519
+ nn_models::parallel::_zero_gradient_branches(device, module);
520
+ if constexpr(SPEC::HAS_HEAD){
521
+ zero_gradient(device, module.head);
522
+ }
523
+ }
524
+ template <typename DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
525
+ RL_TOOLS_FUNCTION_PLACEMENT void add_gradient(DEVICE& device, nn_models::parallel::ModuleGradient<SOURCE_SPEC>& source, nn_models::parallel::ModuleGradient<TARGET_SPEC>& target){
526
+ static_assert(SOURCE_SPEC::NUM_BRANCHES == TARGET_SPEC::NUM_BRANCHES && SOURCE_SPEC::HAS_HEAD == TARGET_SPEC::HAS_HEAD);
527
+ nn_models::parallel::_add_gradient_branches(device, source, target);
528
+ if constexpr(SOURCE_SPEC::HAS_HEAD){
529
+ add_gradient(device, source.head, target.head);
530
+ }
531
+ }
532
+ template <typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
533
+ RL_TOOLS_FUNCTION_PLACEMENT void copy_gradient(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const nn_models::parallel::ModuleGradient<SOURCE_SPEC>& source, nn_models::parallel::ModuleGradient<TARGET_SPEC>& target){
534
+ static_assert(SOURCE_SPEC::NUM_BRANCHES == TARGET_SPEC::NUM_BRANCHES && SOURCE_SPEC::HAS_HEAD == TARGET_SPEC::HAS_HEAD);
535
+ nn_models::parallel::_copy_gradient_branches(source_device, target_device, source, target);
536
+ if constexpr(SOURCE_SPEC::HAS_HEAD){
537
+ copy_gradient(source_device, target_device, source.head, target.head);
538
+ }
539
+ }
540
+
541
+ // ======================== update ========================
542
+ template <typename DEVICE, typename SPEC, typename OPTIMIZER>
543
+ RL_TOOLS_FUNCTION_PLACEMENT void update(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module, OPTIMIZER& optimizer){
544
+ nn_models::parallel::_update_branches(device, module, optimizer);
545
+ if constexpr(SPEC::HAS_HEAD){
546
+ update(device, module.head, optimizer);
547
+ }
548
+ }
549
+
550
+ // ======================== _reset_optimizer_state ========================
551
+ template <typename DEVICE, typename SPEC, typename OPTIMIZER>
552
+ RL_TOOLS_FUNCTION_PLACEMENT void _reset_optimizer_state(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module, OPTIMIZER& optimizer){
553
+ nn_models::parallel::_reset_optimizer_state_branches(device, module, optimizer);
554
+ if constexpr(SPEC::HAS_HEAD){
555
+ _reset_optimizer_state(device, module.head, optimizer);
556
+ }
557
+ }
558
+
559
+ // ======================== reset_forward_state ========================
560
+ template <typename DEVICE, typename SPEC>
561
+ RL_TOOLS_FUNCTION_PLACEMENT void reset_forward_state(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module){
562
+ nn_models::parallel::_reset_forward_state_branches(device, module);
563
+ if constexpr(SPEC::HAS_HEAD){
564
+ reset_forward_state(device, module.head);
565
+ }
566
+ }
567
+
568
+ // ======================== copy ========================
569
+ template <typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
570
+ RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const nn_models::parallel::ModuleForward<SOURCE_SPEC>& source, nn_models::parallel::ModuleForward<TARGET_SPEC>& target){
571
+ nn_models::parallel::_copy_branches(source_device, target_device, source, target);
572
+ if constexpr(SOURCE_SPEC::HAS_HEAD){
573
+ static_assert(TARGET_SPEC::HAS_HEAD, "Source has HEAD but target does not");
574
+ copy(source_device, target_device, source.head, target.head);
575
+ }
576
+ }
577
+
578
+ // ======================== abs_diff ========================
579
+ template <typename DEVICE, typename SPEC_A, typename SPEC_B>
580
+ RL_TOOLS_FUNCTION_PLACEMENT typename SPEC_A::TYPE_POLICY::DEFAULT abs_diff(DEVICE& device, nn_models::parallel::ModuleForward<SPEC_A>& a, const nn_models::parallel::ModuleForward<SPEC_B>& b){
581
+ using T = typename SPEC_A::TYPE_POLICY::DEFAULT;
582
+ T result = nn_models::parallel::_abs_diff_branches(device, a, b);
583
+ if constexpr(SPEC_A::HAS_HEAD){
584
+ result += static_cast<T>(abs_diff(device, a.head, b.head));
585
+ }
586
+ return result;
587
+ }
588
+
589
+ // ======================== is_nan ========================
590
+ template <typename DEVICE, typename SPEC, typename MODE = mode::Default<>>
591
+ RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& model, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
592
+ bool result = nn_models::parallel::_is_nan_branches(device, model, mode);
593
+ if constexpr(SPEC::HAS_HEAD){
594
+ result = result || is_nan(device, model.head, mode);
595
+ }
596
+ return result;
597
+ }
598
+
599
+ // ======================== output ========================
600
+ template <typename DEVICE, typename SPEC>
601
+ RL_TOOLS_FUNCTION_PLACEMENT auto output(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model){
602
+ return view_memory<typename SPEC::OUTPUT_SHAPE>(device, model.output);
603
+ }
604
+ template <typename DEVICE, typename SPEC>
605
+ RL_TOOLS_FUNCTION_PLACEMENT auto output(DEVICE& device, const nn_models::parallel::ModuleGradient<SPEC>& model){
606
+ return view_memory<typename SPEC::OUTPUT_SHAPE>(device, model.output);
607
+ }
608
+
609
+ // ======================== get_last_layer ========================
610
+ template <typename SPEC>
611
+ RL_TOOLS_FUNCTION_PLACEMENT auto& get_last_layer(nn_models::parallel::ModuleForward<SPEC>& model){
612
+ static_assert(SPEC::HAS_HEAD, "get_last_layer on parallel model requires a HEAD module");
613
+ return model.head;
614
+ }
615
+ template <typename SPEC>
616
+ RL_TOOLS_FUNCTION_PLACEMENT auto& get_last_layer(const nn_models::parallel::ModuleForward<SPEC>& model){
617
+ static_assert(SPEC::HAS_HEAD, "get_last_layer on parallel model requires a HEAD module");
618
+ return model.head;
619
+ }
620
+ }
621
+ RL_TOOLS_NAMESPACE_WRAPPER_END
622
+
623
+ #endif