提交 2d5f3b14 authored 作者: Matthew Rocklin's avatar Matthew Rocklin

add rng and skiptest Solve.infer_shape test

上级 98b25ae1
...@@ -443,13 +443,16 @@ class test_Solve(utt.InferShapeTester): ...@@ -443,13 +443,16 @@ class test_Solve(utt.InferShapeTester):
self.op = Solve() self.op = Solve()
def test_infer_shape(self): def test_infer_shape(self):
if not imported_scipy:
raise SkipTest("Scipy needed for the Cholesky op.")
rng = numpy.random.RandomState(utt.fetch_seed())
A = theano.tensor.matrix() A = theano.tensor.matrix()
b = theano.tensor.matrix() b = theano.tensor.matrix()
self._compile_and_check([A, b], # theano.function inputs self._compile_and_check([A, b], # theano.function inputs
[self.op(A, b)], # theano.function outputs [self.op(A, b)], # theano.function outputs
# A must be square # A must be square
[numpy.asarray(numpy.random.rand(5, 5), [numpy.asarray(rng.rand(5, 5),
dtype=config.floatX), dtype=config.floatX),
numpy.asarray(numpy.random.rand(5, 1), numpy.asarray(rng.rand(5, 1),
dtype=config.floatX)], dtype=config.floatX)],
self.op_class) self.op_class)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论