Include directory structure

I am using bazel as my build system instead of cmake. I noticed that the file torch.h is located at include/torch/csrc/api/include/torch/torch.h instead of include/torch/torch.h

I assume then I should configure the project to have the files at include/torch/csrc/api/include/torch/xxx made available via <torch/xxx>.

Is that correct? And are there other include paths that should be configured unconventionally? And what is the rational for this unconventional directory structure?

I usually look at the cpp_extension include path to answer this.
In particular, I don’t think you should be using this particular include anymore. But I have to admit I don’t the rational behind this.

1 Like

Thanks @albanD. I think your link is broken though?

As for the header file, it is needed for this example https://pytorch.org/cppdocs/frontend.html#end-to-end-example

Fixed the link, sorry about that.

Then I don’t know about this include, sorry :confused: