MCPcopy Index your code
hub / github.com/dmlc/dgl / c_array

Function c_array

python/dgl/_ffi/base.py:88–104  ·  view source on GitHub ↗

Create ctypes array from a python array Parameters ---------- ctype : ctypes data type data type of the array we want to convert to values : tuple or list data content Returns ------- out : ctypes array Created ctypes array

(ctype, values)

Source from the content-addressed store, hash-verified

86
87
88def c_array(ctype, values):
89 """Create ctypes array from a python array
90
91 Parameters
92 ----------
93 ctype : ctypes data type
94 data type of the array we want to convert to
95
96 values : tuple or list
97 data content
98
99 Returns
100 -------
101 out : ctypes array
102 Created ctypes array
103 """
104 return (ctype * len(values))(*values)
105
106
107def decorate(func, fwrapped):

Callers 3

numpyasarrayFunction · 0.85
emptyFunction · 0.85
empty_shared_memFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected