Added tests for the lifter opts

上级 3a1b8bbb
......@@ -274,6 +274,12 @@ def test_adv_subtensor():
class test_gpuextractdiag(unittest.TestCase):
def test_extractdiag_opt(self):
x = tensor.matrix()
fn = theano.function([x], tensor.ExtractDiag()(x), mode=mode_with_gpu)
assert any([isinstance(node.op, GpuExtractDiag)
for node in fn.maker.fgraph.toposort()])
def test_matrix(self):
x = tensor.matrix()
np_x = np.arange(77).reshape(7, 11).astype(theano.config.floatX)
......@@ -308,6 +314,12 @@ class test_gpuextractdiag(unittest.TestCase):
class test_gpuallocdiag(unittest.TestCase):
def test_allocdiag_opt(self):
x = tensor.vector()
fn = theano.function([x], tensor.AllocDiag()(x), mode=mode_with_gpu)
assert any([isinstance(node.op, GpuAllocDiag)
for node in fn.maker.fgraph.toposort()])
def test_matrix(self):
x = tensor.vector()
np_x = np.arange(7).astype(theano.config.floatX)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论