MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / is_numpy_ndarray

Function is_numpy_ndarray

tinygrad/helpers.py:77–77  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

75def getbits(value: int, start: int, end: int): return (value >> start) & ((1 << (end - start + 1)) - 1)
76def i2u(bits: int, value: int): return value if value >= 0 else (1<<bits)+value
77def is_numpy_ndarray(x) -> bool: return str(type(x)) == "<class 'numpy.ndarray'>"
78def merge_dicts(ds:Iterable[dict[T,U]]) -> dict[T,U]:
79 kvs = set([(k,v) for d in ds for k,v in d.items()])
80 if len(kvs) != len(set(kv[0] for kv in kvs)): raise RuntimeError(f"{kvs} contains different values for the same key")

Callers 7

__init__Method · 0.90
_parse_inputMethod · 0.90
test_ndarrayMethod · 0.90
test_ndarray_tolistMethod · 0.90
test_listMethod · 0.90
test_tensorMethod · 0.90
test_tensor_numpyMethod · 0.90

Calls

no outgoing calls

Tested by 5

test_ndarrayMethod · 0.72
test_ndarray_tolistMethod · 0.72
test_listMethod · 0.72
test_tensorMethod · 0.72
test_tensor_numpyMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…