提交 5cfa6e2b authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Change test, because it was building an incorrect graph.

It makes no sense to have a softmax_grad node with inputs that are not matrices of the same size. C implementation would have complained. T_SoftmaxGrad.test_infer_shape now passes in FAST_COMPILE.
上级 5df0aeca
......@@ -89,9 +89,9 @@ class T_SoftmaxWithBias(unittest.TestCase):
class T_SoftmaxGrad(unittest.TestCase):
def test_infer_shape(self):
a=T.constant(numpy.random.rand(3,4))
b=T.constant(numpy.random.rand(4))
b=T.constant(numpy.random.rand(3,4))
f=theano.function([],softmax_grad(a,b).shape)
assert f()==[4]
assert numpy.all(f()==[3,4])
class T_CrossentropySoftmax1Hot(unittest.TestCase):
def setUp(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论