Skip to content

Commit

Permalink
Merge pull request #24932 from hawkinsp:gather
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 697632284
  • Loading branch information
Google-ML-Automation committed Nov 18, 2024
2 parents ccb3317 + 1d519f4 commit 65f9c78
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jax/_src/lax/lax.py
Original file line number Diff line number Diff line change
Expand Up @@ -4544,6 +4544,8 @@ def shape_as_value(shape: core.Shape):
"""Converts a shape that may contain Poly values into a JAX value."""
if len(shape) == 0:
return full((0,), np.array(0, np.int64))
if core.is_constant_shape(shape):
return np.asarray(shape, dtype=np.int64)
dims = [
expand_dims(convert_element_type(core.dimension_as_value(d), np.int64),
(0,))
Expand Down

0 comments on commit 65f9c78

Please sign in to comment.