google-jax

Rewriting for loop with jax.lax.scan

Rewriting for loop with jax.lax.scan Question: I’m having troubles understanding the JAX documentation. Can somebody give me a hint on how to rewrite simple code like this with jax.lax.scan? numbers = numpy.array( [ [3.0, 14.0], [15.0, -7.0], [16.0, -11.0] ]) evenNumbers = 0 for row in numbers: for n in row: if n % 2 …

Total answers: 1