linalg.py 文件源码

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

项目:npstreams 作者: LaurentRDC 项目源码 文件源码
def _ireduce_linalg(arrays, func, **kwargs):
    """
    Yield the cumulative reduction of a linag algebra function
    """
    arrays = iter(arrays)
    first = next(arrays)
    second = next(arrays)

    func = partial(func, **kwargs)

    accumulator = func(first,  second)
    yield accumulator

    for array in arrays:
        # For some reason, np.dot(..., out = accumulator) did not produce results
        # that were equal to numpy.linalg.multi_dot
        func(accumulator, array, out = accumulator)
        yield accumulator
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号