MCPcopy
hub / github.com/dmlc/dgl / register

Function register

python/dgl/_ffi/object.py:105–113  ·  view source on GitHub ↗

internal register function

(cls)

Source from the content-addressed store, hash-verified

103 object_name = type_key if isinstance(type_key, str) else type_key.__name__
104
105 def register(cls):
106 """internal register function"""
107 tindex = ctypes.c_int()
108 ret = _LIB.DGLObjectTypeKey2Index(
109 c_str(object_name), ctypes.byref(tindex)
110 )
111 if ret == 0:
112 _register_object(tindex.value, cls)
113 return cls
114
115 if isinstance(type_key, str):
116 return register

Callers 1

register_objectFunction · 0.70

Calls 2

c_strFunction · 0.85
_register_objectFunction · 0.85

Tested by

no test coverage detected