MCPcopy
hub / github.com/tinygrad/tinygrad / get_single_element

Function get_single_element

tinygrad/helpers.py:89–91  ·  view source on GitHub ↗
(x:Sequence[T])

Source from the content-addressed store, hash-verified

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]
92def get_child(obj, key):
93 for k in key.split('.'):
94 if k.isnumeric(): obj = obj[int(k)]

Callers 9

renderMethod · 0.90
_resolve_constFunction · 0.90
symbolic.pyFile · 0.90
__call__Method · 0.90
_apply_tc_optMethod · 0.90
flatten_bufferizeFunction · 0.90
simple_matmul.pyFile · 0.90
run_one_schedule_itemFunction · 0.90

Calls

no outgoing calls

Tested by 2

run_one_schedule_itemFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…