提交 2b4ad225 authored 作者: abalkin's avatar abalkin

Issue #1057: Added a more informative test.

上级 f2273924
import numpy
import numpy.linalg
from numpy.testing import assert_array_almost_equal
import theano
from theano import tensor, function
......@@ -486,6 +487,13 @@ class test_Eig(utt.InferShapeTester):
[X.dot(X.T)],
self.op_class)
def test_eval(self):
import math
A = theano.tensor.matrix()
self.assertEquals([e.eval({A: [[1]]}) for e in self.op(A)],
[[1.0], [[1.0]]])
w, v = [e.eval({A: [[0, 1], [1, 0]]})
for e in self.op(A)]
assert_array_almost_equal(w, [1, -1])
x = math.sqrt(2)/2
assert_array_almost_equal(v, [[x, -x], [x, x]])
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论