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

Add kwargs to aesara.graph.basic.clone_get_equiv

This allows one to specify the options passed to `Apply.clone_with_new_inputs`.
上级 65a69cbb
...@@ -1069,6 +1069,7 @@ def clone_get_equiv( ...@@ -1069,6 +1069,7 @@ def clone_get_equiv(
Dict[Union[Apply, Variable, "Op"], Union[Apply, Variable, "Op"]] Dict[Union[Apply, Variable, "Op"], Union[Apply, Variable, "Op"]]
] = None, ] = None,
clone_inner_graphs: bool = False, clone_inner_graphs: bool = False,
**kwargs,
) -> Dict[Union[Apply, Variable, "Op"], Union[Apply, Variable, "Op"]]: ) -> Dict[Union[Apply, Variable, "Op"], Union[Apply, Variable, "Op"]]:
r"""Clone the graph between `inputs` and `outputs` and return a map of the cloned objects. r"""Clone the graph between `inputs` and `outputs` and return a map of the cloned objects.
...@@ -1099,6 +1100,8 @@ def clone_get_equiv( ...@@ -1099,6 +1100,8 @@ def clone_get_equiv(
dictionary and return it. dictionary and return it.
clone_inner_graphs clone_inner_graphs
If ``True``, clone `HasInnerGraph` `Op`\s and their inner-graphs. If ``True``, clone `HasInnerGraph` `Op`\s and their inner-graphs.
kwargs
Keywords passed to `Apply.clone_with_new_inputs`.
""" """
if memo is None: if memo is None:
...@@ -1124,7 +1127,9 @@ def clone_get_equiv( ...@@ -1124,7 +1127,9 @@ def clone_get_equiv(
else: else:
memo[input] = input memo[input] = input
clone_node_and_cache(apply, memo, clone_inner_graphs=clone_inner_graphs) clone_node_and_cache(
apply, memo, clone_inner_graphs=clone_inner_graphs, **kwargs
)
# finish up by cloning any remaining outputs (it can happen) # finish up by cloning any remaining outputs (it can happen)
for output in outputs: for output in outputs:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论