#include #include #define FOREACH_LIBRARY(_) \ _(array) \ _(_asyncio) \ _(audioop) \ _(binascii) \ _(_bisect) \ _(_blake2) \ _(_bz2) \ _(cmath) \ _(_codecs_cn) \ _(_codecs_hk) \ _(_codecs_iso2022) \ _(_codecs_jp) \ _(_codecs_kr) \ _(_codecs_tw) \ _(_contextvars) \ _(_crypt) \ _(_csv) \ _(_ctypes) \ _(_ctypes_test) \ _(_curses) \ _(_curses_panel) \ _(_datetime) \ _(_decimal) \ _(_elementtree) \ _(fcntl) \ _(grp) \ _(_hashlib) \ _(_heapq) \ _(_json) \ _(_lsprof) \ _(_lzma) \ _(math) \ _(_md5) \ _(mmap) \ _(_multibytecodec) \ _(_multiprocessing) \ _(nis) \ _(_opcode) \ _(ossaudiodev) \ _(parser) \ _(_pickle) \ _(_posixsubprocess) \ _(pyexpat) \ _(_queue) \ _(_random) \ _(readline) \ _(resource) \ _(select) \ _(_sha1) \ _(_sha256) \ _(_sha3) \ _(_sha512) \ _(_socket) \ _(spwd) \ _(_ssl) \ _(_struct) \ _(syslog) \ _(termios) \ _(_testbuffer) \ _(_testcapi) \ _(_testimportmultiple) \ _(_testmultiphase) \ _(unicodedata) \ _(xxlimited) \ _(_xxtestfuzz) \ _(zlib) #define DECLARE_LIBRARY_INIT(name) extern "C" PyObject* PyInit_##name(void); FOREACH_LIBRARY(DECLARE_LIBRARY_INIT) #undef DECLARE_LIBRARY_INIT extern "C" struct _frozen _PyImport_FrozenModules[]; #define STD_LIBARY_PARMS(name) , #name, PyInit_##name REGISTER_TORCH_DEPLOY_BUILTIN( frozenpython, _PyImport_FrozenModules FOREACH_LIBRARY(STD_LIBARY_PARMS)); #undef STD_LIBARY_PARMS