Skip to content

Commit

Permalink
[numpy] Fix users of NumPy APIs that are removed in NumPy 2.0.
Browse files Browse the repository at this point in the history
This change migrates users of APIs removed in NumPy 2.0 to their recommended replacements (https://numpy.org/devdocs/numpy_2_0_migration_guide.html).

PiperOrigin-RevId: 656022757
  • Loading branch information
hawkinsp authored and fedjax authors committed Jul 25, 2024
1 parent ce348b0 commit 64cbc49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fedjax/core/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _msgpack_ext_pack(x):
_bytes_ndarray_to_bytes(x))
elif isinstance(x, (np.ndarray, jax.Array)):
return msgpack.ExtType(_MsgpackExtType.ndarray, _ndarray_to_bytes(x))
elif np.issctype(type(x)):
elif isinstance(x, np.generic):
# pack scalar as ndarray
return msgpack.ExtType(_MsgpackExtType.npscalar,
_ndarray_to_bytes(np.asarray(x)))
Expand Down

0 comments on commit 64cbc49

Please sign in to comment.