提交 c171d871 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

made UncomputableOp support None as an argument

(needed to express that gradient with respect to x is undefined if x is allowed to be None)
上级 2d299c61
......@@ -636,6 +636,8 @@ class UncomputableOp(Op):
return "Uncomputable{%s,%s}"%(self.exc,self.msg)
def make_node(self,x):
if x is None:
x = graph.Constant(theano.gof.type.generic,None)
return graph.Apply(self, [x], [x.type()] )
def perform(self, node, inputs, out_storage):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论