pytorch/docs/source
Peter Goldsborough 7949250295 Fixes for Torch Script C++ API (#11682)
Summary:
A couple fixes I deem necessary to the TorchScript C++ API after writing the tutorial:

1. When I was creating the custom op API, I created `torch/op.h` as the one-stop header for creating custom ops. I now notice that there is no good header for the TorchScript C++ story altogether, i.e. when you just want to load a script module in C++ without any custom ops necessarily. The `torch/op.h` header suits that purpose just as well of course, but I think we should rename it to `torch/script.h`, which seems like a great name for this feature.

2. The current API for the CMake we provided was that we defined a bunch of variables like `TORCH_LIBRARY_DIRS` and `TORCH_INCLUDES` and then expected users to add those variables to their targets. We also had a CMake function that did that for you automatically. I now realized a much smarter way of doing this is to create an `IMPORTED` target for the libtorch library in CMake, and then add all this stuff to the link interface of that target. Then all downstream users have to do is `target_link_libraries(my_target torch)` and they get all the proper includes, libraries and compiler flags added to their target. This means we can get rid of the CMake function and all that stuff. orionr  AFAIK this is a much, much better way of doing all of this, no?

3. Since we distribute libtorch with `D_GLIBCXX_USE_CXX11_ABI=0`, dependent libraries must set this flag too. I now add this to the interface compile options of this imported target.

4. Fixes to JIT docs.

These could likely be 4 different PRs but given the release I wouldn't mind landing them all asap.

zdevito dzhulgakov soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11682

Differential Revision: D9839431

Pulled By: goldsborough

fbshipit-source-id: fdc47b95f83f22d53e1995aa683e09613b4bfe65
2018-09-17 09:54:50 -07:00
..
_static i2h<->h2h in gif (#8750) 2018-06-21 14:46:47 -04:00
_templates docs: add canonical_url and fix redirect link (#8155) 2018-06-05 10:29:55 -04:00
notes Typo fix in randomness.rst (#11571) 2018-09-12 08:25:46 -07:00
scripts Add CELU activation to pytorch (#8551) 2018-08-01 07:54:44 -07:00
autograd.rst Add autograd automatic anomaly detection (#7677) 2018-06-11 21:26:17 -04:00
bottleneck.rst [docs] Clarify more CUDA profiling gotchas in bottleneck docs (#6763) 2018-04-19 13:15:27 -04:00
checkpoint.rst [docs] Fix some sphinx warnings (#6764) 2018-04-19 12:37:42 -04:00
conf.py Improvements on conv/pool/fold/stft/ParamDict docs (#11106) 2018-09-11 08:56:21 -07:00
cpp_extension.rst Inline JIT C++ Extensions (#7059) 2018-04-30 11:48:44 -04:00
cuda.rst Fix Python docs for broadcast and braodcast_coalesced (#4727) 2018-01-19 10:57:20 -05:00
cudnn_deterministic.rst WIP: Include note on cudnn determinism in each function backed by cudnn (#11434) 2018-09-11 20:27:09 -07:00
data.rst add fold example and add nn.Fold/nn.Unfold and F.fold/F.unfold to doc (#8600) 2018-06-18 09:36:42 -04:00
distributed_deprecated.rst Documentation for c10d: torch.distributed and deprecate the old distributed doc (#11450) 2018-09-11 02:10:28 -07:00
distributed.rst Documentation for c10d: torch.distributed and deprecate the old distributed doc (#11450) 2018-09-11 02:10:28 -07:00
distributions.rst NegativeBinomial distribution (#9345) 2018-08-01 08:39:25 -07:00
dlpack.rst document torch.utils.dlpack (#9343) 2018-07-11 07:46:09 -07:00
ffi.rst Improve ffi utils (#479) 2017-01-18 11:17:01 -05:00
index.rst Sphinx is case sensitive 2018-09-13 10:33:06 -07:00
jit.rst Fixes for Torch Script C++ API (#11682) 2018-09-17 09:54:50 -07:00
legacy.rst Add anything in torch.legacy docs 2017-01-16 12:59:47 -05:00
model_zoo.rst Add model_zoo utility torch torch.utils (#424) 2017-01-09 13:16:58 -05:00
multiprocessing.rst Typofix 2017-10-13 01:31:22 +02:00
nn.rst Order Loss functions alphabetically in nn.rst 2018-08-08 22:39:55 -07:00
onnx.rst Add trigonometry functions to docs/source/onnx.rst 2018-09-12 12:10:01 -07:00
optim.rst Add Cosine Annealing LR Scheduler (#3311) 2017-12-18 02:43:08 -05:00
sparse.rst Remove methods that start with an underscore from at::Tensor (#11152) 2018-09-07 11:55:11 -07:00
storage.rst Start documenting torch.Tensor (#377) 2016-12-30 01:21:34 -05:00
tensor_attributes.rst Update device docs (#6887) 2018-04-23 19:04:20 -04:00
tensors.rst Add matrix power (#11421) 2018-09-08 15:25:56 -07:00
torch.rst Add matrix power (#11421) 2018-09-08 15:25:56 -07:00