MCPcopy
hub / github.com/tinygrad/tinygrad / register_fields

Method register_fields

tinygrad/runtime/support/c.py:48–50  ·  view source on GitHub ↗
(cls, fields)

Source from the content-addressed store, hash-verified

46
47 @classmethod
48 def register_fields(cls, fields):
49 setattr(cls, "_real_fields_", fields)
50 for i, (name, *args) in enumerate(fields): setattr(cls, name, Field(*args, name=name, idx=i))
51
52def record(cls) -> type[Struct]:
53 setattr(cls, "_fields_", [('_mem_', ctypes.c_byte * cls.SIZE)])

Callers 15

corefoundation.pyFile · 0.80
iokit.pyFile · 0.80
kgsl.pyFile · 0.80
libclang.pyFile · 0.80
vfio.pyFile · 0.80
amdgpu_drm.pyFile · 0.80
ggml_common.pyFile · 0.80
io_uring.pyFile · 0.80
comgr_3.pyFile · 0.80
mlx5.pyFile · 0.80
qcom_dsp.pyFile · 0.80
mesa.pyFile · 0.80

Calls 1

FieldClass · 0.85

Tested by

no test coverage detected