[ez] add docblock for RuntimeAssert (#154401)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154401
Approved by: https://github.com/Skylion007
ghstack dependencies: #154374, #154375, #154376, #154386
This commit is contained in:
bobrenjc93 2025-05-27 13:19:32 -07:00 committed by PyTorch MergeBot
parent d64b4a91dd
commit b82fb57b67

View File

@ -2361,12 +2361,15 @@ def _lru_cache(
return wrapper # type: ignore[return-value]
# This is pretty similar to ShapeGuard but it also comes with a message,
# and is exclusively used for things that MUST be true (unlike guards,
# which can evaluate False, in which case you just choose not to use
# a particular specialization)
@dataclass(frozen=True)
class RuntimeAssert:
"""
This is pretty similar to ShapeGuard but it also comes with a message,
and is exclusively used for things that MUST be true (unlike guards,
which can evaluate False, in which case you just choose not to use
a particular specialization)
"""
expr: SympyBoolean
msg: str = field(repr=False)
stack: CapturedTraceback = field(repr=False)