提交 94254c7d authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Do not require fgraph.clients entries in `RandomVariable` opts

上级 fbde872e
......@@ -119,7 +119,8 @@ def local_dimshuffle_rv_lift(fgraph, node):
# If no one else is using the underlying `RandomVariable`, then we can
# do this; otherwise, the graph would be internally inconsistent.
if not all(
(n == node or isinstance(n.op, Shape)) for n, i in fgraph.clients[base_rv]
(n == node or isinstance(n.op, Shape))
for n, i in fgraph.clients.get(base_rv, ())
):
return False
......@@ -273,7 +274,8 @@ def local_subtensor_rv_lift(fgraph, node):
# If no one else is using the underlying `RandomVariable`, then we can
# do this; otherwise, the graph would be internally inconsistent.
if not all(
(n == node or isinstance(n.op, Shape)) for n, i in fgraph.clients[base_rv]
(n == node or isinstance(n.op, Shape))
for n, i in fgraph.clients.get(base_rv, ())
):
return False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论