MCPcopy
hub / github.com/tinygrad/tinygrad / encode

Method encode

tinygrad/runtime/support/amd.py:10–10  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

8 def __post_init__(self): self.addr:dict[int, int] = { inst: bases[self.segment] + self.offset for inst, bases in self.bases.items() }
9
10 def encode(self, **kwargs) -> int: return functools.reduce(int.__or__, (value << self.fields[name][0] for name,value in kwargs.items()), 0)
11 def decode(self, val: int) -> dict: return {name:getbits(val, start, end) for name,(start,end) in self.fields.items()}
12
13 def fields_mask(self, *names) -> int:

Callers 15

wregMethod · 0.45
execMethod · 0.45
__init__Method · 0.45
compileMethod · 0.45
open_libMethod · 0.45
to_ns_strFunction · 0.45
compileMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
_copyinMethod · 0.45
_workerMethod · 0.45
compileMethod · 0.45

Calls 1

reduceMethod · 0.45

Tested by

no test coverage detected