test_array_stream.py 文件源码

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

项目:npstreams 作者: LaurentRDC 项目源码 文件源码
def test_multiprocessing(self):
        """ Test that ipipe(f, g, h, arrays) -> f(g(h(arr))) for arr in arrays """
        stream = [np.random.random((15,7,2,1)) for _ in range(10)]
        squared = [np.cbrt(np.square(arr)) for arr in stream]
        pipeline = ipipe(np.cbrt, np.square, stream, processes = 2)

        self.assertTrue(all(np.allclose(s, p) for s, p in zip(pipeline, squared)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号