mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[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:
parent
d64b4a91dd
commit
b82fb57b67
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user