提交 5e9d4ed3 authored 作者: Frederic's avatar Frederic

use more direct fct call.

上级 75049c1c
......@@ -584,7 +584,7 @@ class Function(object):
# done by raise_with_op is not implemented in C.
if hasattr(self.fn, 'thunks'):
# For the CVM
gof.vm.raise_with_op(
gof.link.raise_with_op(
self.fn.nodes[self.fn.position_of_error],
self.fn.thunks[self.fn.position_of_error])
else:
......
......@@ -1427,6 +1427,8 @@ class Assert(T.Op):
self.msg = "Theano Assert failed!"
def make_node(self, value, *conds):
if not isinstance(value, Variable):
value = T.as_tensor_variable(value)
cond = [T.as_tensor_variable(c) for c in conds]
assert numpy.all([c.type.ndim == 0 for c in cond])
return gof.Apply(self, [value] + cond, [value.type()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论