MCPcopy
hub / github.com/tinygrad/tinygrad / getenv

Function getenv

tinygrad/helpers.py:157–157  ·  view source on GitHub ↗
(key:str)

Source from the content-addressed store, hash-verified

155def to_function_name(s:str): return ''.join([c if c in (string.ascii_letters+string.digits+'_') else f'{ord(c):02X}' for c in ansistrip(s)])
156@overload
157def getenv(key:str) -> int: ...
158@overload
159def getenv(key:str, default:T) -> T: ...
160@functools.cache

Callers 15

__call__Method · 0.90
_select_deviceMethod · 0.90
compile_cachedMethod · 0.90
_select_rendererMethod · 0.90
dtype.pyFile · 0.90
sum_acc_dtypeFunction · 0.90
_bufferMethod · 0.90
from_ggufMethod · 0.90
_renderMethod · 0.90
ClangRendererClass · 0.90
render_vector_prefixMethod · 0.90
CPULLVMRendererClass · 0.90

Calls

no outgoing calls

Tested by 15

test_matmulFunction · 0.72
test_matmulFunction · 0.72
test_sumMethod · 0.72
test_gemmMethod · 0.72
test_gemvMethod · 0.72
test_index_mnistMethod · 0.72
test_llama_embeddingMethod · 0.72
test_scalarMethod · 0.72
test_delayedMethod · 0.72
_test_conv2dFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…