Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions drjax/_src/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _define_broadcast_prim(
def broadcast_prim_fn(x, *, mesh=None):
return broadcast_p.bind(x, mesh=mesh)

return (broadcast_p, broadcast_prim_fn)
return (broadcast_p, broadcast_prim_fn) # pyrefly: ignore[bad-return]


def _register_broadcast_impls(
Expand Down Expand Up @@ -249,7 +249,7 @@ def _batch_agg(xs, batched_shape):
# Certain jax libs can silently insert the 'batching' dim 'all the way at
# the front'; we are about to destroy the front axis by agging, so move
# that puppy to the back. Tell the rest of JAX what happened here.
xs = jnp.moveaxis(*xs, *batched_shape, -1)
xs = jnp.moveaxis(*xs, *batched_shape, -1) # pyrefly: ignore[bad-argument-count]
return agg_prim_fn(xs), len(xs.shape) - 2

# Make sure this can also be batched / mapped. This happens when dispatching
Expand Down Expand Up @@ -301,7 +301,7 @@ def broadcast_array_eval(x, *, mesh):
_register_broadcast_impls(
broadcast_p,
broadcast_prim_fn,
broadcast_array_eval,
broadcast_array_eval, # pyrefly: ignore[bad-argument-type]
sum_prim_fn,
placement_str,
n_elements,
Expand All @@ -317,7 +317,7 @@ def broadcast_array_eval(x, *, mesh):
mean_p,
mean_prim_fn,
impl_defs.mean_from_placement,
lambda x: jnp.divide(broadcast_prim_fn(x), n_elements),
lambda x: jnp.divide(broadcast_prim_fn(x), n_elements), # pyrefly: ignore[bad-argument-type]
)


Expand Down
Loading