Hi,
I am creating a custom c++ extension but I get an error on compiling when I add #include <torch/extension.h> with the error:
pytorch/torch/include/torch/csrc/api/include/torch/ordered_dict.h:13:7: error: redefinition of 'OrderedDict'
class OrderedDict {
^
pytorch/torch/csrc/api/include/torch/ordered_dict.h:13:7: note: previous definition is here
class OrderedDict {
My setup.py looks like:
setup(
name="pytorch_extension",
version="0.1",
description="PyTorch Extension",
packages=find_packages(exclude=['build']),
install_requires=[],
ext_modules=[
CppExtension(
'EXTENSION_NAME',
sources,
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
library_dirs=[],
extra_link_args=[]
),
],
cmdclass={
'build_ext': BuildExtension,
'clean': Clean,
}
)
// Fails
#include "torch/extension.h"
// #include "torch/csrc/jit/python/pybind.h" (works)
PYBIND11_MODULE(EXTENSION_NAME, m) {
...
}