提交 9fa53f44 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

In MakeVector, check size of allocated output.

上级 a23392bf
...@@ -521,7 +521,7 @@ class MakeVector(T.Op): ...@@ -521,7 +521,7 @@ class MakeVector(T.Op):
def perform(self, node, inputs, out_): def perform(self, node, inputs, out_):
out, = out_ out, = out_
# not calling theano._asarray as optimization # not calling theano._asarray as optimization
if out[0] is None: if (out[0] is None) or (out[0].size != len(inputs)):
out[0] = theano._asarray(inputs, dtype=node.outputs[0].dtype) out[0] = theano._asarray(inputs, dtype=node.outputs[0].dtype)
else: else:
# assume that out has correct dtype. there is no cheap way to check # assume that out has correct dtype. there is no cheap way to check
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论