MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / cint8_array_to_numpy

Function cint8_array_to_numpy

python-package/lightgbmmt/basic.py:116–121  ·  view source on GitHub ↗

Convert a ctypes int pointer array to a numpy array.

(cptr, length)

Source from the content-addressed store, hash-verified

114
115
116def cint8_array_to_numpy(cptr, length):
117 """Convert a ctypes int pointer array to a numpy array."""
118 if isinstance(cptr, ctypes.POINTER(ctypes.c_int8)):
119 return np.fromiter(cptr, dtype=np.int8, count=length)
120 else:
121 raise RuntimeError('Expected int pointer')
122
123
124def c_str(string):

Callers 1

get_fieldMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected