提交 b14960b4 authored 作者: Benjamin Scellier's avatar Benjamin Scellier

file theano/compile/tests/test_ops.py

上级 6137cd66
...@@ -9,7 +9,6 @@ from theano.tests import unittest_tools as utt ...@@ -9,7 +9,6 @@ from theano.tests import unittest_tools as utt
from theano import function from theano import function
import theano import theano
from theano.tensor import dmatrix, dvector from theano.tensor import dmatrix, dvector
from numpy import allclose
from theano.compile import as_op from theano.compile import as_op
import pickle import pickle
...@@ -34,7 +33,7 @@ class OpDecoratorTests(utt.InferShapeTester): ...@@ -34,7 +33,7 @@ class OpDecoratorTests(utt.InferShapeTester):
r = fn([[1.5, 5], [2, 2]]) r = fn([[1.5, 5], [2, 2]])
r0 = np.array([1.5, 7.5, 15., 30.]) r0 = np.array([1.5, 7.5, 15., 30.])
assert allclose(r, r0), (r, r0) assert np.allclose(r, r0), (r, r0)
def test_2arg(self): def test_2arg(self):
x = dmatrix('x') x = dmatrix('x')
...@@ -50,7 +49,7 @@ class OpDecoratorTests(utt.InferShapeTester): ...@@ -50,7 +49,7 @@ class OpDecoratorTests(utt.InferShapeTester):
r = fn([[1.5, 5], [2, 2]], [1, 100, 2, 200]) r = fn([[1.5, 5], [2, 2]], [1, 100, 2, 200])
r0 = np.array([2.5, 107.5, 17., 230.]) r0 = np.array([2.5, 107.5, 17., 230.])
assert allclose(r, r0), (r, r0) assert np.allclose(r, r0), (r, r0)
def test_infer_shape(self): def test_infer_shape(self):
x = dmatrix('x') x = dmatrix('x')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论