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
评论列表
文章目录