MCPcopy
hub / github.com/tinygrad/tinygrad / resolve

Function resolve

tinygrad/uop/ops.py:37–41  ·  view source on GitHub ↗
(x:UOp|bool, default:bool=True)

Source from the content-addressed store, hash-verified

35
36# With True as the default, this matches the old symbolic behavior
37def 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
44def _suop(lst, uop_fxn, python_fxn):

Callers 15

_attentionMethod · 0.90
_attentionMethod · 0.90
__call__Method · 0.90
_pad_constantMethod · 0.90
meanMethod · 0.90
varMethod · 0.90
_parse_view_indexMethod · 0.90
_poolMethod · 0.90
hand_coded_optimizationsFunction · 0.90
split_reduceopFunction · 0.90
rangeify.pyFile · 0.90
new_rangeMethod · 0.90

Calls 1

simplifyMethod · 0.45

Tested by 2

mock_callMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…