Files
pytorch/functorch/csrc/dim/dim_opcode.c
PyTorch MergeBot ae5be038a6 Revert "Delete functorch C extension entirely. (#163340)"
This reverts commit 1faf6367e396b1d0894e8735912a47ac465f469d.

Reverted https://github.com/pytorch/pytorch/pull/163340 on behalf of https://github.com/wdvr due to temporary revert to pull out #162659 ([comment](https://github.com/pytorch/pytorch/pull/163340#issuecomment-3317105243))
2025-09-22 06:20:04 +00:00

18 lines
476 B
C

#include <torch/csrc/utils/python_compat.h>
#if defined(_WIN32) && IS_PYTHON_3_11_PLUS
#define Py_BUILD_CORE
#define NEED_OPCODE_TABLES // To get _PyOpcode_Deopt, _PyOpcode_Caches
#if IS_PYTHON_3_13_PLUS
#include <cpython/code.h> // To get PyUnstable_Code_GetFirstFree
#define NEED_OPCODE_METADATA
#include "internal/pycore_opcode_metadata.h"
#undef NEED_OPCODE_METADATA
#else
#include "internal/pycore_opcode.h"
#endif
#undef NEED_OPCODE_TABLES
#undef Py_BUILD_CORE
#endif