ndarray.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:bifrost 作者: ledatelescope 项目源码 文件源码
def _address_as_buffer(address, nbyte, readonly=False):
    if address is None:
        raise ValueError("Cannot create buffer from NULL pointer")
    # Note: This doesn't work as a buffer when using pypy
    # return (ctypes.c_byte*nbyte).from_address(address)
    # Note: This works as a buffer in regular python and pypy
    # Note: int_asbuffer is undocumented; see here:
    # https://mail.scipy.org/pipermail/numpy-discussion/2008-January/030938.html
    return np.core.multiarray.int_asbuffer(
        address, nbyte, readonly=readonly, check=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号