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

Check identity first in equal_computations

上级 e0ea29ae
...@@ -1518,6 +1518,8 @@ def equal_computations(xs, ys, in_xs=None, in_ys=None): ...@@ -1518,6 +1518,8 @@ def equal_computations(xs, ys, in_xs=None, in_ys=None):
results to be more efficient. results to be more efficient.
""" """
if nd_x is nd_y:
return True
if nd_x.op != nd_y.op: if nd_x.op != nd_y.op:
return False return False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论