MCPcopy
hub / github.com/tinygrad/tinygrad / unwrap

Function unwrap

tinygrad/helpers.py:86–88  ·  view source on GitHub ↗
(x:T|None)

Source from the content-addressed store, hash-verified

84 for s in itr: (ret[0] if fxn(s) else ret[1]).append(s)
85 return ret
86def unwrap(x:T|None) -> T:
87 assert x is not None
88 return x
89def get_single_element(x:Sequence[T]) -> T:
90 assert len(x) == 1, f"{x} must only have 1 element"
91 return x[0]

Callers 15

ssaMethod · 0.90
nimm_setFunction · 0.90
_encodeFunction · 0.90
schedule_stepMethod · 0.90
fold_divmod_generalFunction · 0.90
pm_rewriteMethod · 0.90
cached_bpm_rewriteMethod · 0.90
unified_rewriteMethod · 0.90
lt_foldingFunction · 0.90
__init__Method · 0.90
invalidate_cachesMethod · 0.90
hw_copy_queuesMethod · 0.90

Calls

no outgoing calls

Tested by 1

dataMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…