MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / InitializeNumpyAPIForTypes

Function InitializeNumpyAPIForTypes

tensorflow/compiler/xla/python/types.cc:26–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace py = pybind11;
25
26bool InitializeNumpyAPIForTypes() {
27 // Caution: import_array1 works by initializing a static variable
28 // (PyArray_API) which is *defined* in a NumPy header. import_array1() must
29 // therefore be called from the *same translation unit* as any users of
30 // NumPy C APIs (here PyArray_View). This awkward wrapper function
31 // must not be inlined into its caller.
32 import_array1(false);
33 return true;
34}
35
36xla::StatusOr<PrimitiveType> DtypeToPrimitiveType(const py::dtype& np_type) {
37 static auto* types =

Callers 2

PYBIND11_MODULEFunction · 0.85
PYBIND11_MODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected