(x:UOp|bool, default:bool=True)
| 35 | |
| 36 | # With True as the default, this matches the old symbolic behavior |
| 37 | def resolve(x:UOp|bool, default:bool=True): |
| 38 | if isinstance(x, bool): return x |
| 39 | assert x.dtype == dtypes.bool, "UOp in resolve must be bool" |
| 40 | # NOTE: generating the text for the exception is expensive, so we do this |
| 41 | return bool(sx.vmin) if (sx:=x.simplify()).vmin == sx.vmax else default |
| 42 | |
| 43 | # smax/smin are replacements for max/min that preserve symbolic |
| 44 | def _suop(lst, uop_fxn, python_fxn): |
searching dependent graphs…