FHof / torchquad

Multidimensional numerical integration on the GPU using PyTorch
https://www.esa.int/gsp/ACT/open_source/torchquad/
GNU General Public License v3.0
0 stars 0 forks source link

Replace a Python for loop with broadcasting in MonteCarlo.calculate_sample_points #29

Closed FHof closed 2 years ago

FHof commented 2 years ago

This makes MonteCarlo faster with torch, tensorflow and uncompiled jax, especially when the dimensionality is high.

Python for loop (before): compilations_MonteCarlo_8_sin_prod_float32_before

Broadcasting (after): compilations_MonteCarlo_8_sin_prod_float32_after