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

fix test in float32.

上级 efed2a4e
......@@ -161,22 +161,22 @@ def test_rop_lop():
def test_det():
rng = numpy.random.RandomState(utt.fetch_seed())
r = rng.randn(5, 5)
r = rng.randn(5, 5).astype(config.floatX)
x = tensor.matrix()
f = theano.function([x], det(x))
assert numpy.linalg.det(r) == f(r)
assert numpy.allclose(numpy.linalg.det(r), f(r))
def test_det_grad():
rng = numpy.random.RandomState(utt.fetch_seed())
r = rng.randn(5, 5)
r = rng.randn(5, 5).astype(config.floatX)
tensor.verify_grad(det, [r], rng=numpy.random)
def test_det_shape():
rng = numpy.random.RandomState(utt.fetch_seed())
r = rng.randn(5, 5)
r = rng.randn(5, 5).astype(config.floatX)
x = tensor.matrix()
f = theano.function([x], det(x))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论