parray.py 文件源码

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

项目:neurodriver 作者: neurokernel 项目源码 文件源码
def complextofloat(dtype):
    """ convert dtype from complex to corresponding real dtype """
    dtype = dtype.type if isinstance(dtype, np.dtype) else dtype
    if not issubclass(dtype, np.complexfloating):
        outdtype = dtype
    elif dtype == np.complex64:
        outdtype = np.float32
    elif dtype == np.complex128:
        outdtype = np.float64
    else:
        raise TypeError("input dtype " + str(dtype) +
                        " cannot be translated to floating")
    return np.dtype(outdtype)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号