[ez] add docblock for _guard_or (#154384)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154384
Approved by: https://github.com/pianpwk
ghstack dependencies: #154374, #154375, #154376, #154386, #154401, #154404, #154405, #154377, #154378, #154379, #154380, #154381, #154383
This commit is contained in:
bobrenjc93
2025-05-27 13:19:36 -07:00
committed by PyTorch MergeBot
parent e9b97d19b1
commit ee4f433963

View File

@ -1339,6 +1339,9 @@ def compute_unbacked_bindings(
# assuming expand/reshape inputs are not -1. or assuming the non-broadcasting path.
#
def _guard_or(a: BoolLikeType, default: bool) -> bool:
"""
Try to guard a, if data dependent error encountered just return default.
"""
if not isinstance(a, SymBool):
assert isinstance(a, bool)
return a