
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Adds tqdm
progress bars to jax.lax.scan
and jax.lax.fori_loop
. Progress bars commonly used in Python, such as tqdm, are not compatible with JAX's jit-compiled functions due to restrictions on side effects like printing. tqdx
addresses this limitation by using callbacks to update progress bars created on the host.
import tqdx
...
carry, ys = tqdx.scan(f, init, xs)
Processing: 100%|███████████████████████████████████████████| 50/50 [02:38<00:00, 3.20s/it]
jax.lax.scan
and jax.lax.fori_loop
.jax.jit
: Progress bars show up even inside jit-compiled code.jax.lax.scan
and jax.lax.fori_loop
with tqdx.scan
and tqdx.fori_loop
.The following example demonstrates how to use tqdx
with jax.lax.scan
and jax.lax.fori_loop
. You can arbitrarily nest these functions, and the progress bars will still work correctly.
import jax
import tqdx
from time import sleep
def step(carry, x):
def body_fun(i, val):
jax.debug.callback(lambda: sleep(0.5))
return val + i
jax.debug.callback(lambda: sleep(0.5))
carry = tqdx.fori_loop(0, 10, body_fun, carry)
return carry, x + 1
def f(xs):
return tqdx.scan(step, 0, xs)
xs = jax.numpy.arange(10)
result, _ = jax.jit(f)(xs)
pip install tqdx
FAQs
JAX compatible progress bars for scan and fori_loop.
We found that tqdx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.