numpy.shares_memory
-
Determine if two arrays share memory
- Parameters
-
-
a, bndarray
-
Input arrays
-
max_workint, optional
-
Effort to spend on solving the overlap problem (maximum number of candidate solutions to consider). The following special values are recognized:
- max_work=MAY_SHARE_EXACT (default)
-
The problem is solved exactly. In this case, the function returns True only if there is an element shared between the arrays.
- max_work=MAY_SHARE_BOUNDS
-
Only the memory bounds of a and b are checked.
-
- Returns
-
-
outbool
-
- Raises
-
- numpy.TooHardError
-
Exceeded max_work.
See also
Examples
>>> np.may_share_memory(np.array([1,2]), np.array([5,8,9])) False
© 2005–2020 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.18/reference/generated/numpy.shares_memory.html