Skip to content
Merged
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
11 changes: 11 additions & 0 deletions skops/io/_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,17 @@ def _construct(self):
(np.random.RandomState, random_state_get_state),
(np.random.Generator, random_generator_get_state),
]

try:
# From numpy=1.25.0 dispatching for `__array_function__` is done via
# a C wrapper: https://github.com/numpy/numpy/pull/23020
from numpy.core._multiarray_umath import _ArrayFunctionDispatcher

GET_STATE_DISPATCH_FUNCTIONS.append((_ArrayFunctionDispatcher, function_get_state))
except ImportError:
pass


# tuples of type and function that creates the instance of that type
NODE_TYPE_MAPPING = {
("NdArrayNode", PROTOCOL): NdArrayNode,
Expand Down