提交 f9a913fd authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Merge pull request #1003 from goodfeli/master

Remove a bad unit test
......@@ -2253,7 +2253,7 @@ class Test_alloc_zero(unittest.TestCase):
def test_setsubtensor_allocs1(self):
y = tensor.matrix()
x0 = tensor.constant(numpy.asarray(numpy.zeros_like((4, 4)),
x0 = tensor.constant(numpy.asarray(numpy.zeros((4, 4)),
dtype=config.floatX))
y0 = tensor.zeros_like(y)
z = tensor.set_subtensor(x0[:4], y0)
......@@ -2263,7 +2263,7 @@ class Test_alloc_zero(unittest.TestCase):
def test_setsubtensor_allocs1t(self):
y = tensor.matrix()
x0 = tensor.constant(numpy.asarray(numpy.zeros_like((4, 4)),
x0 = tensor.constant(numpy.asarray(numpy.zeros((4, 4)),
dtype=config.floatX))
y0 = tensor.zeros_like(y)
z = tensor.set_subtensor(x0[:4], y0.T)
......
......@@ -131,23 +131,6 @@ class testgrad_sources_inputs(unittest.TestCase):
self.assertTrue(g[a1.inputs[0]] is gval0)
self.assertTrue(g[a1.inputs[1]] is gval1)
def test_some_None_ograds(self):
"""Test grad is called when some output gradients are None"""
class O(gof.op.Op):
def __init__(self, tst):
self.tst = tst
def make_node(self, *inputs):
outputs = [theano.tensor.matrix(), theano.tensor.matrix()]
return gof.Apply(self, inputs, outputs)
def grad(self, inputs, g_out):
return [one]
i = theano.tensor.matrix()
a1 = O(self).make_node(i)
g = grad_sources_inputs([(a1.outputs[0], one)], None)
self.assertTrue(g[i] is one)
def test_unimplemented_grad_func():
# tests that function compilation catches unimplemented grads in the graph
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论