提交 5bb13bbb authored 作者: Sina Honari's avatar Sina Honari

adding comment on negation

上级 d2e5db6b
...@@ -4423,6 +4423,9 @@ class Reshape(Op): ...@@ -4423,6 +4423,9 @@ class Reshape(Op):
return [requ] return [requ]
else: else:
new_dims = [node.inputs[1][i] for i in xrange(self.ndim)] new_dims = [node.inputs[1][i] for i in xrange(self.ndim)]
# since new_dims has one negative value (-1), the
# multiplication of all values should be negated
# to give a positive value
return [tuple([switch(eq(new_dims[i], -1), return [tuple([switch(eq(new_dims[i], -1),
theano.tensor.mul(*ishapes[0]) // theano.tensor.mul(*ishapes[0]) //
(-theano.tensor.mul(*new_dims)), (-theano.tensor.mul(*new_dims)),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论