torch 1.4 build error
I get this error when using with torch 1.4.0a0+7f73f1d
pytorch_compiler_tutorial/src/register.cpp:44:14: error: invalid user-defined conversion from ‘pybind11_init_pointwise_compiler(pybind11::module&)::<lambda(const torch::jit::Node*)>’ to ‘torch::jit::OperationCreator {aka std::function<int(std::vector<c10::IValue, std::allocator<c10::IValue> >&)> (*)(const torch::jit::Node*)}’ [-fpermissive]
options)});
pytorch_compiler_tutorial/src/register.cpp:44:16: error: no matching function for call to ‘c10::RegisterOperators::RegisterOperators(<brace-enclosed initializer list>)’
options)});
I had run into same issue - seems like there were some changes to API with recent pytorch code. Looking into examples elsewhere in pytorch code, tried rewriting it as foll. and it seems to compile better (although I moved to a different issue now - when executing import pointwise_compiler : It encounters undefined symbol: _ZTIN5torch3jit9GraphAttrE (typeinfo for torch::jit::GraphAttr)
RegisterOperators op({Operator( pointwise_compiler_symbol, [](const Node* node) -> Operation { auto compiler = std::make_shared<PointwiseCompiler>(node); return [compiler](Stack& stack) { compiler->run(stack); return 0; }; }, c10::AliasAnalysisKind::PURE_FUNCTION)});
@ananthdurbha I met the same issue with yours. I'm wondering if you have resolved it?
Solve this issue by using clang++ and build pytorch from source. There may be other better solutions.