提交 d51e6057 authored 作者: Sina Honari's avatar Sina Honari

adding comment for multiple -1 values

上级 5bb13bbb
...@@ -4425,7 +4425,9 @@ class Reshape(Op): ...@@ -4425,7 +4425,9 @@ class Reshape(Op):
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 # since new_dims has one negative value (-1), the
# multiplication of all values should be negated # multiplication of all values should be negated
# to give a positive value # to give a positive value.
# To avoid optimization complexity, we avoid checking
# for the case when there are two or more '-1' values.
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论