MCPcopy Create free account
hub / github.com/pytorch/executorch / __bool__

Method __bool__

exir/pass_base.py:152–157  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

150 yield from self.data
151
152 def __bool__(self) -> bool:
153 if isinstance(self.data, (torch.SymInt, torch.SymFloat, torch.SymBool)):
154 raise ExportPassBaseError(
155 "ProxyValue with symbolic data cannot be used in boolean context."
156 )
157 return bool(self.data)
158
159 def __int__(self):
160 if isinstance(self.data, torch.SymInt):

Callers

nothing calls this directly

Calls 1

ExportPassBaseErrorClass · 0.85

Tested by

no test coverage detected