本文簡要介紹 python 語言中 numpy.may_share_memory
的用法。
確定兩個數組是否可能共享內存
返回 True 並不一定意味著兩個數組共享任何元素。這隻是意味著他們可能。
默認情況下隻檢查 a 和 b 的內存邊界。
- a, b: ndarray
輸入數組
- max_work: 整數,可選
努力解決重疊問題。有關詳細信息,請參閱
shares_memory
。may_share_memory
的默認設置是進行邊界檢查。
- out: bool
參數:
返回:
例子:
>>> np.may_share_memory(np.array([1,2]), np.array([5,8,9])) False >>> x = np.zeros([3, 4]) >>> np.may_share_memory(x[:,0], x[:,1]) True
相關用法
- Python numpy ma.indices用法及代碼示例
- Python numpy matrix.A1用法及代碼示例
- Python numpy ma.zeros用法及代碼示例
- Python numpy matrix.T用法及代碼示例
- Python numpy matrix.I用法及代碼示例
- Python numpy ma.diff用法及代碼示例
- Python numpy mat用法及代碼示例
- Python numpy ma.mask_rowcols用法及代碼示例
- Python numpy ma.where用法及代碼示例
- Python numpy ma.zeros_like用法及代碼示例
- Python numpy ma.notmasked_contiguous用法及代碼示例
- Python numpy ma.concatenate用法及代碼示例
- Python numpy ma.apply_along_axis用法及代碼示例
- Python numpy matrix.partition用法及代碼示例
- Python numpy ma.compress_rowcols用法及代碼示例
- Python numpy matrix.transpose用法及代碼示例
- Python numpy ma.vstack用法及代碼示例
- Python numpy ma.atleast_3d用法及代碼示例
- Python numpy ma.count用法及代碼示例
- Python numpy matrix.itemsize用法及代碼示例
- Python numpy ma.fix_invalid用法及代碼示例
- Python numpy ma.mean用法及代碼示例
- Python numpy ma.argmax用法及代碼示例
- Python numpy matrix.newbyteorder用法及代碼示例
- Python numpy matrix.sort用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.may_share_memory。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。