提交 0ac05faf authored 作者: Frederic's avatar Frederic

Add speed test code for mrg state creation

上级 fca1603a
...@@ -793,3 +793,14 @@ def test_multMatVect(): ...@@ -793,3 +793,14 @@ def test_multMatVect():
r_b = f0.fn() r_b = f0.fn()
assert numpy.allclose(r_a, r_b) assert numpy.allclose(r_a, r_b)
if __name__ == "__main__":
rng = MRG_RandomStreams(numpy.random.randint(2147462579))
import time
print theano.__file__
pvals = theano.tensor.fmatrix()
for i in range(10):
t0 = time.time()
multinomial = rng.multinomial(pvals=pvals)
print time.time() - t0
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论