A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.lax.optimization_barrier.html below:

jax.lax.optimization_barrier — JAX documentation

jax.lax.optimization_barrier#
jax.lax.optimization_barrier(operand, /)[source]#

Prevents the compiler from moving operations across the barrier.

Optimization barriers have a number of possible uses:

JAX does not define derivative or batching rules for an optimization barrier.

Optimization barriers have no effect outside a compiled function.

Parameters:

operand – a pytree of JAX values.

Returns:

A pytree of JAX values, with the same structure and contents as operand.

Examples

Prevents common-subexpression elimination between the two calls to sin:

>>> def f(x):
...   return jax.lax.optimization_barrier(jax.lax.sin(x)) + jax.lax.sin(x)
>>> jax.jit(f)(0.)
Array(0., dtype=float32, weak_type=True)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3