提交 b72ed60b authored 作者: Frederic Bastien's avatar Frederic Bastien

fix strange numpy problem that raised an error in debug mode. This don't affect running code.

上级 ba1a476f
...@@ -770,11 +770,9 @@ class StructuredDot(gof.Op): ...@@ -770,11 +770,9 @@ class StructuredDot(gof.Op):
else: else:
raise Exception("a.shape=%s, b.shape=%s, variable.shape=%s ??? I have no idea why") raise Exception("a.shape=%s, b.shape=%s, variable.shape=%s ??? I have no idea why")
## Commenting this out because variable should be a numpy.ndarray since the "assert _is_dense(variable)" above #The cast is needed as otherwise we hit the bug mentioned into
## (JB 20090109) #theano._asarray function documentation.
# out[0] = numpy.asarray(variable) #TODO: fix this really bad implementation out[0] = theano._asarray(variable, str(variable.dtype))
#
out[0] = variable
def grad(self, (a,b), (g_out,)): def grad(self, (a,b), (g_out,)):
# a is sparse, b is dense, g_out is dense # a is sparse, b is dense, g_out is dense
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论