3

I create a pytorch extention, followed by this link but it throws out the error that

fatal error: torch/extension.h: No such file or directory.

ubuntu 18.04
code::blocks 17.04
gcc 7.4.0
#include <torch/extension.h>

I expect the code to run. Is there any document to fix this problem?

Meraj al Maksud
  • 1,528
  • 2
  • 22
  • 36
Cery
  • 203
  • 5
  • 14
  • 1
    Have you installed the necessary development libraries? – Stephen Newell Jul 29 '19 at 02:28
  • The compiler can't find the file. So either the file doesn't exist in the right folder (i.e. you didn't set up torch properly?) or you haven't updated your project's include directories. See https://stackoverflow.com/questions/12919081/gcc-g-no-such-file-or-directory – Tas Jul 29 '19 at 02:29
  • i find https://pytorch.org/cppdocs/installing.html doc to install c++ extention for pytorch @StephenNewell – Cery Jul 29 '19 at 02:38

1 Answers1

2

is the canonical header file that create Python bindings for C++/Cuda extensions. So Try upgrading the version of Pytorch if it's not in newest version.

neelesh bisht
  • 640
  • 8
  • 13