test_profiler.py 文件源码

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

项目:data_profiler 作者: numba 项目源码 文件源码
def test_jit(self):

        a = numpy.arange(16, dtype=numpy.float32)
        b = numpy.arange(16, dtype=numpy.float32)
        p = profile.Profile()
        cfunc = jit(nopython=True)(dot)
        p.enable()
        cfunc(a, b)
        p.disable()
        stats = pstats.Stats(p).strip_dirs()
        shp = str(a.shape)
        expected = ('test_profiler.py',
                    6,
                    'dot(a:ndarray(dtype=float32, shape={s}), '.format(s=shp)+
                    'b:ndarray(dtype=float32, shape={s}))'.format(s=shp)
                    )
        assert expected in stats.stats
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号