mirror of
https://github.com/ROCm/jax.git
synced 2025-04-16 11:56:07 +00:00
Merge pull request #24932 from hawkinsp:gather
PiperOrigin-RevId: 697632284
This commit is contained in:
commit
65f9c7855e
@ -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,))
|
||||
|
Loading…
x
Reference in New Issue
Block a user