ndarray.py 文件源码

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

项目:Aurora 作者: upul 项目源码 文件源码
def empty(shape, ctx=cpu(0)):
    """Create an empty array given shape and device
    Parameters
    ----------
    shape : tuple of int
        The shape of the array
    ctx : DLContext
        The context of the array
    Returns
    -------
    arr : ndarray
        The array dlsys supported.
    """
    shape = c_array(ctypes.c_int64, shape)
    ndim = ctypes.c_int(len(shape))
    handle = DLArrayHandle()
    check_call(_LIB.DLArrayAlloc(
        shape, ndim, ctx, ctypes.byref(handle)))
    return NDArray(handle)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号