mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[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:
committed by
PyTorch MergeBot
parent
e9b97d19b1
commit
ee4f433963
@ -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
|
||||
|
Reference in New Issue
Block a user