提交 ed59b021 authored 作者: Shawn Tan's avatar Shawn Tan

Minor corrections to test.

上级 b22932bb
...@@ -7597,21 +7597,20 @@ def test_alloc_diag(): ...@@ -7597,21 +7597,20 @@ def test_alloc_diag():
) )
assert np.all(rediag == test_val) assert np.all(rediag == test_val)
# Test infer_shape # Test infer_shape
f_shape = theano.function([x], adiag_op(x).shape) f_shape = theano.function([x], adiag_op(x).shape)
theano.printing.debugprint(f_shape.maker.fgraph.outputs[0]) theano.printing.debugprint(f_shape.maker.fgraph.outputs[0])
output_shape = f_shape(test_val) output_shape = f_shape(test_val)
assert diag_arr.shape == output_shape assert np.all(diag_arr.shape == output_shape)
rediag_shape = np.diagonal( rediag_shape = np.diagonal(
np.ones(output_shape), np.ones(output_shape),
offset=offset, offset=offset,
axis1=axis1, axis1=axis1,
axis2=axis2 axis2=axis2
) ).shape
assert rediag_shape == test_val.shape print(rediag_shape)
print(test_val.shape)
assert np.all(rediag_shape == test_val.shape)
class test_numpy_assumptions(unittest.TestCase): class test_numpy_assumptions(unittest.TestCase):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论