mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE] Fix edge case in translation validation bisector (#145414)
This patch fixes a small bug for the binary-search algorithm in translation validation bisector. Fixes #131303. Pull Request resolved: https://github.com/pytorch/pytorch/pull/145414 Approved by: https://github.com/ysiraichi, https://github.com/zou3519
This commit is contained in:
committed by
PyTorch MergeBot
parent
045698653a
commit
a86fa779ce
@ -819,7 +819,13 @@ def bisect(shape_env):
|
||||
]
|
||||
|
||||
# Preparing the indices for binary search.
|
||||
# The overall invariants are
|
||||
# - for all i < left, assert_node[i] doesn't fail
|
||||
# - for all i >= right, assert_node[i] fails
|
||||
# - `right in exception` always holds
|
||||
# - `left <= right` always holds
|
||||
left, mid, right = 0, 0, len(assert_nodes) - 1
|
||||
exception[right] = check_node_fails(assert_nodes[right])
|
||||
|
||||
while left < right:
|
||||
mid = (left + right) // 2
|
||||
|
Reference in New Issue
Block a user