Commit Graph

151 Commits

Author SHA1 Message Date
81e030d9a6 Upgrade flake8-bugbear to master, fix the new lints. (#18507)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18507
ghimport-source-id: 1c3642befad2da78a7e5f39d6d58732b85c76267

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18507 Upgrade flake8-bugbear to master, fix the new lints.**

It turns out Facebobok is internally using the unreleased master
flake8-bugbear, so upgrading it grabs a few more lints that Phabricator
was complaining about but we didn't get in open source.

A few of the getattr sites that I fixed look very suspicious (they're
written as if Python were a lazy language), but I didn't look more
closely into the matter.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

Differential Revision: D14633682

fbshipit-source-id: fc3f97c87dca40bbda943a1d1061953490dbacf8
2019-03-27 08:07:41 -07:00
674c274d92 Change deprecated IntList to IntArrayRef
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18262

Differential Revision: D14612244

Pulled By: ezyang

fbshipit-source-id: 5d21c7b94d64104fececcb15c6d38d9bd2a1fc70
2019-03-25 19:47:21 -07:00
4ac91b2d64 add debug/release tip to cpp docs (#17452)
Summary:
as title. These were already added to the tutorials, but I didn't add them to the cpp docs.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17452

Differential Revision: D14206501

Pulled By: suo

fbshipit-source-id: 89b5c8aaac22d05381bc4a7ab60d0bb35e43f6f5
2019-02-24 23:08:15 -08:00
1b3315ec17 improve libtorch install docs with GPU note (#17299)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/15702
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17299

Differential Revision: D14149712

Pulled By: soumith

fbshipit-source-id: 5b83110bb00e4d4dad04c1f293c2b52e41711f11
2019-02-20 06:30:08 -08:00
47bf30661f Directly include headers from ATen.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16287

Differential Revision: D13792949

Pulled By: ZolotukhinM

fbshipit-source-id: d627d8dc469df048063c70d0b5b8d33fede809a3
2019-01-24 11:22:27 -08:00
e669f72466 fix sigma in the middle of when word (#16227)
Summary:
there is a random sigma in the when word on :
https://pytorch.org/cppdocs/contributing.html
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16227

Differential Revision: D13762753

Pulled By: goldsborough

fbshipit-source-id: 3d4bf4be859a3069402fe8c3fbc8ebee4f25cc5a
2019-01-23 08:35:32 -08:00
dfcafb1f71 cpp doc fix (#16221)
Summary:
Fixed a few C++ API callsites to work with v1.0.1.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16221

Differential Revision: D13759207

Pulled By: yf225

fbshipit-source-id: bd92c2b95a0c6ff3ba5d73cb249d0bc88cfdc340
2019-01-21 21:56:22 -08:00
b9b160d86f Remove ATen/Half.h and ATen/core/Half.h forwarding headers.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16115

Reviewed By: bddppq

Differential Revision: D13717049

fbshipit-source-id: fb1d690183a932a1fa1a2d235f3219520f51620a
2019-01-18 10:55:21 -08:00
d408324350 Move files to/from c10/core and c10/util (#15316)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15316

This starts cleaning up the files in c10 according to the module structure we decided on.

Move to c10/util:
- Half.h, Half-inl.h, Half.cpp, bitcasts.h

Move to c10/core:
- Device.h, Device.cpp
- DeviceType.h, DeviceType.cpp

i-am-not-moving-c2-to-c10

Reviewed By: dzhulgakov

Differential Revision: D13498493

fbshipit-source-id: dfcf1c490474a12ab950c72ca686b8ad86428f63
2019-01-10 16:22:22 -08:00
c5012d8641 Extend note about contributing to the C++ frontend (#15902)
Summary:
soumith ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15902

Differential Revision: D13628525

Pulled By: goldsborough

fbshipit-source-id: 70cf36d1bacd9d689d4fa4f2290886fd3765e89b
2019-01-10 14:22:00 -08:00
382807302c Fix C++ Frontend example in frontend.html (#15717)
Summary:
The small end-to-end example in https://pytorch.org/cppdocs/frontend.html is a little outdated and needs fixes.

ezyang soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15717

Differential Revision: D13591306

Pulled By: goldsborough

fbshipit-source-id: 3334d68c7f77cf094b66ec2b2f396c4c65bb0d72
2019-01-07 11:39:47 -08:00
321a559359 Fix restructured text issue in tensor_basics.rst (#15701)
Summary:
Fix submitted by huntzhan in https://github.com/pytorch/cppdocs/pull/4. The source is in this repo so the patch has to be applied here.

soumith ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15701

Differential Revision: D13591302

Pulled By: goldsborough

fbshipit-source-id: 796957696fd560a9c5fb42265d7b2d018abaebe3
2019-01-07 11:35:19 -08:00
60b13d1f71 Use at::zeros instead of torch::zeros in non-differentiable example (#15527)
Summary:
There was a typo in C++ docs.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15527

Differential Revision: D13547858

Pulled By: soumith

fbshipit-source-id: 1f5250206ca6e13b1b1443869b1e1c837a756cb5
2018-12-25 21:50:17 -08:00
07d20b1e7c Fix documentation (#15372)
Summary:
Current documentation example doesn't compile. This fixes the doc so the example works.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15372

Differential Revision: D13522167

Pulled By: goldsborough

fbshipit-source-id: 5171a5f8e165eafabd9d1a28d23020bf2655f38b
2018-12-19 15:04:24 -08:00
2d485ffb17 Move CUDAGuard, CUDAStream and CUDAGuardImpl to c10/cuda (#14248)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14248

This diff also introduces a horrifying hack to override CUDA's DeviceGuardImpl
with a HIPGuardImplMasqueradingAsCUDA, to accommodate PyTorch's current
behavior of pretending CUDA is HIP when you build with ROCm enabled.

Reviewed By: bddppq

Differential Revision: D13145293

fbshipit-source-id: ee0e207b6fd132f0d435512957424a002d588f02
2018-12-12 11:24:26 -08:00
2d60afbc90 Remove outdated css file and refs in cpp conf.py (#14779)
Summary:
pytorch_theme.css is no longer necessary for the cpp or html docs site build. The new theme styles are located at https://github.com/pytorch/pytorch_sphinx_theme. The Lato font is also no longer used in the new theme.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14779

Differential Revision: D13356125

Pulled By: ezyang

fbshipit-source-id: c7635eb7512c7dcaddb9cad596ab3dbc96480144
2018-12-05 21:55:45 -08:00
5c1692840e Remove OptionsGuard from ATen (#14524)
Summary:
Resubmission of https://github.com/pytorch/pytorch/pull/13738
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14524

Differential Revision: D13268031

Pulled By: goldsborough

fbshipit-source-id: fb306464b673c05ebd26d0f44d688ccd92d1d8c5
2018-11-30 13:30:35 -08:00
49fe678fec Add variable_factories.h to cppdocs (#14381)
Summary:
This will document `torch::from_blob` and such.

soumith ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14381

Differential Revision: D13216560

Pulled By: goldsborough

fbshipit-source-id: 112f60e45e4d38a8a9983fa71e9cc56bc1a73465
2018-11-27 10:13:23 -08:00
55e1b1ec3e Fix docs/cpp/requirements.txt (#14121)
Summary:
soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14121

Differential Revision: D13108063

Pulled By: goldsborough

fbshipit-source-id: 35cf65ba776e8826c5cab7ae6d3a2d446f87e7cc
2018-11-16 14:56:30 -08:00
2fe4711eb4 Revert "Remove OptionsGuard from ATen (#13738)" (#14082)
Summary:
This reverts commit 37cb357d8da3427900b8f72f6de7e77b77dcdbae.

Try to see if it unbreaks master
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14082

Differential Revision: D13095888

Pulled By: bddppq

fbshipit-source-id: c728f80f233b4d9daaf65f43202d8104651029a9
2018-11-15 23:47:36 -08:00
37cb357d8d Remove OptionsGuard from ATen (#13738)
Summary:
Deletes the `OptionsGuard` from ATen. This works towards the goal of reworking `DefaultTensorOptions`. `OptionsGuard` is troublesome because it relies on mutating thread local state. This PR fixes those code locations and then deletes the `OptionsGuard`.

ezyang gchanan
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13738

Differential Revision: D13000962

Pulled By: goldsborough

fbshipit-source-id: c8143ee75070c2280f5fd1d9af86f8ce14279b72
2018-11-15 17:37:27 -08:00
6d378d3740 Updating C++ documentation to PyTorch theme. (#13791)
Summary:
Updates C++ documentation to the PyTorch Sphinx theme.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13791

Reviewed By: soumith

Differential Revision: D13013908

Pulled By: brianjo

fbshipit-source-id: 253a91c6784ad72aa1c37426cd4a945061a60fec
2018-11-15 16:45:52 -08:00
0478d32cb8 Move AlignOf, SmallVector and ArrayRef to c10.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13916

Reviewed By: smessmer

Differential Revision: D13046722

fbshipit-source-id: 1583d3170d60e22f0a535cd1fd56bdf928186f5d
2018-11-14 11:13:16 -08:00
393ad6582d Use torch:: instead of at:: in all C++ APIs (#13523)
Summary:
In TorchScript and C++ extensions we currently advocate a mix of `torch::` and `at::` namespace usage. In the C++ frontend I had instead exported all symbols from `at::` and some from `c10::` into the `torch::` namespace. This is far, far easier for users to understand, and also avoid bugs around creating tensors vs. variables. The same should from now on be true for the TorchScript C++ API (for running and loading models) and all C++ extensions.

Note that since we're just talking about typedefs, this change does not break any existing code.

Once this lands I will update stuff in `pytorch/tutorials` too.

zdevito ezyang gchanan
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13523

Differential Revision: D12942787

Pulled By: goldsborough

fbshipit-source-id: 76058936bd8707b33d9e5bbc2d0705fc3d820763
2018-11-06 14:32:25 -08:00
e2272dd312 Remove ATen/README.md in favor of cppdocs/notes/tensor_basics.rst (#13601)
Summary:
Removes aten/README.md (and some other files dating from when aten was its own repo), and moves the not outdated documentation into a note called "Tensor Basics". I updated the text lightly but did not overhaul the content.

CC zdevito

ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13601

Differential Revision: D12934480

Pulled By: goldsborough

fbshipit-source-id: 012a4267b4d6f27e4d5d55d6fc66363ddca10b41
2018-11-05 19:13:50 -08:00
84cfc28f23 Note on Tensor Creation
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13517

Differential Revision: D12914271

Pulled By: goldsborough

fbshipit-source-id: df64fca6652525bc814f6fd3e486c87bff29b5b5
2018-11-05 16:10:58 -08:00
a4778862c7 Docs/cpp misc features and fixes (#12914)
Differential Revision: D10502199

Pulled By: ezyang

fbshipit-source-id: ec7523caf37d2c92a0e7a2981e1badf51b93dd05
2018-10-31 15:22:45 -07:00
80f766e5cd Create FAQ (#13129)
Summary:
Creates a FAQ. https://github.com/pytorch/tutorials/pull/345 now just links to this page.

soumith ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13129

Differential Revision: D10854264

Pulled By: goldsborough

fbshipit-source-id: 6e57574ffa61409d4d9d1750aa618893b897ad41
2018-10-26 15:44:51 -07:00
34cca9f05b Move Device and DeviceType to c10
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12995

Reviewed By: Yangqing

Differential Revision: D10513246

fbshipit-source-id: 0c6d52e09166d7e8a786c1a0e21685ec9c35b12a
2018-10-24 08:27:44 -07:00
f575e138d8 Credits to Exhale in cppdocs (#12926)
Summary:
Some creds to svenevs

soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12926

Differential Revision: D10498288

Pulled By: goldsborough

fbshipit-source-id: 878d23ebf260dac17871677635a3283eb3a8a423
2018-10-22 15:39:36 -07:00
5f37c0afda Fix doxygen check
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12920

Differential Revision: D10494081

Pulled By: goldsborough

fbshipit-source-id: c96b9b61cbae39006b48b23b901248e762cbd232
2018-10-22 12:28:17 -07:00
08aab4dfdd remove ATen/Error.h and ATen/core/Error.h (#12792)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12792

This is a follow up diff after D10238910.

Only non-codemod change is the removal of ATen/Error.h and ATen/core/Error.h. Other files are basically changing the inclusion path + clang format for inclusion order.

Reviewed By: bddppq

Differential Revision: D10437824

fbshipit-source-id: 7f885f80ab5827468d1351cfb2765d0e3f555a69
2018-10-17 17:25:42 -07:00
e8d8ccb34a Emphasize that the /path/to/libtorch must be absolute (#12660)
Summary:
ezyang soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12660

Differential Revision: D10386952

Pulled By: goldsborough

fbshipit-source-id: efd82f2aa3a349e9acd29303984b8fd7c3208c3f
2018-10-15 13:41:18 -07:00
a74cc03aa7 Use branch of exhale that fixes overloads (#12668)
Summary:
Docs for [`torch::jit::load`](https://pytorch.org/cppdocs/api/function_namespacetorch_1_1jit_1ace2c44fb8af5905ae17834e81086b8a3.html#exhale-function-namespacetorch-1-1jit-1ace2c44fb8af5905ae17834e81086b8a3) are currently broken. svenevs has a fix on this branch, and we need to update to it.

soumith ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12668

Differential Revision: D10386949

Pulled By: goldsborough

fbshipit-source-id: 1887ba53989e5a77b178f8b2782a7b3ae52b7405
2018-10-15 13:39:01 -07:00
a91f3338a0 Some documentation fixes (#12521)
Summary:
ezyang soumith

Partly addresses https://github.com/pytorch/cppdocs/issues/2
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12521

Differential Revision: D10374244

Pulled By: goldsborough

fbshipit-source-id: 8e9fe688cbaa2d2b0b96f721e5477ee8845b8f20
2018-10-13 14:20:42 -07:00
e25b8869f7 typo: Aten.h -> ATen.h in cppdocs
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12519

Differential Revision: D10287901

Pulled By: goldsborough

fbshipit-source-id: 56e0c1851aade84e4154777776d14e087645a762
2018-10-09 23:40:14 -07:00
8468b7d3f0 Fix tensor doc (#12469)
Summary:
The C++ docs for `at::Tensor` are currently broken because we moved the place `Tensor.h` gets generated to without updating our docs. I use `GEN_TO_SOURCE=1` when generating ATen files, so the `Tensor.h` file should end up in `aten/src/ATen/core/Tensor.h` if i understand correctly.

dzhulgakov ezyang gchanan
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12469

Differential Revision: D10248521

Pulled By: goldsborough

fbshipit-source-id: 8d8a11f0f6e2703b8d767dbc523fc34a4374f345
2018-10-09 14:09:22 -07:00
29e5ba8a7b Fix for LibTorch download link (#12263)
Summary:
We now have a proper download link for libtorch.

ezyang soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12263

Differential Revision: D10149216

Pulled By: goldsborough

fbshipit-source-id: e9caefed1c7f8e25d7623d72c8548bfdb6114329
2018-10-02 12:25:25 -07:00
c3817e85fa Temporary fix for LibTorch download link (#12212)
Summary:
We're waiting for the libtorch links to show up on the website. I had a fake link in the docs so far which is misleading. This PR changes it to a temporary markdown file until the web people fix the site tomorrow.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12212

Differential Revision: D10121872

Pulled By: goldsborough

fbshipit-source-id: f1bd1315f7333b9168e99983f3f6b679c9b0c52a
2018-09-30 15:39:51 -07:00
0f81039eaf Better high level C++ documentation (#12079)
Summary:
I wrote some high level docs for the larger PyTorch C++ universe and the C++ frontend specifically. Happy for reviews, but let's please also land this ASAP so I can point users at something that looks more ready baked than the C++ docs landing page (https://pytorch.org/cppdocs) does right now.

ezyang soumith

CC ebetica
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12079

Differential Revision: D10080785

Pulled By: goldsborough

fbshipit-source-id: 3028de41373f307468eb1e3802aa27871c93b2e3
2018-09-26 20:57:43 -07:00
e585f2fb48 Polish CPP docs, Minor Python Docs Fixes (#11722)
Differential Revision: D9919120

Pulled By: goldsborough

fbshipit-source-id: bf14cbe4ab79524495957cb749828046af864aab
2018-09-18 14:55:57 -07:00
63c811b3a6 Include some JIT things in C++ docs (#11712)
Summary:
Since we're making parts of the JIT public as part of loading script modules, they should be on the cppdocs website.

Orthogonal: We decided not to export things like `IValue` into the `torch` namespace, so `RegisterOperators` shouldn't be there either.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11712

Differential Revision: D9837578

Pulled By: goldsborough

fbshipit-source-id: 4c06d2fa9dd4b4216951f27424c2ce795febab9c
2018-09-17 23:29:04 -07:00
8e3f8c52e8 Document the Sequential module (#11648)
Summary:
1. Document the Sequential module in the C++ API at a high, why-does-this-exist, and low, how-to-use, level
2. Change the Sequential tests to be in a style that makes them easier to convert to gtest. No code changes.

ebetica ezyang apaszke
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11648

Differential Revision: D9834526

Pulled By: goldsborough

fbshipit-source-id: 39f2f5c6cbbf8ed5a1b69986978c8ef127036de1
2018-09-14 15:51:41 -07:00
b14a80553d Ignore functional doc error
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/11508

Differential Revision: D9764380

Pulled By: goldsborough

fbshipit-source-id: 3abb9c04f46137be833ea26d67734741e14f8010
2018-09-10 20:55:48 -07:00
77b6d7d255 Doc improvements (#11347)
Summary:
1. Remove cudnn* symbols from C++ docs
2. Fix code examples for `nn::Module` and `jit::compile`
3. Document Dropout
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11347

Differential Revision: D9716751

Pulled By: goldsborough

fbshipit-source-id: e0566cec35848335cac3eb9196cb244bb0c8fa45
2018-09-07 14:39:36 -07:00
fb4e8088f3 Remove methods that start with an underscore from at::Tensor (#11152)
Summary:
This PR cleans up the `at::Tensor` class by removing all methods that start with an underscore in favor of functions in the `at::` namespace. This greatly cleans up the `Tensor` class and makes it clearer what is the public and non-public API.

For this I changed `native_functions.yaml` and `Declarations.cwrap` to make all underscore methods `variant: function` (or add such a statement to begin with), and then fixed all code locations using the underscore methods.

ezyang colesbury gchanan
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11152

Differential Revision: D9683607

Pulled By: goldsborough

fbshipit-source-id: 97f869f788fa56639c05a439e2a33be49f10f543
2018-09-07 11:55:11 -07:00
ed8849b640 Add include path to Doxygen preprocessing and add some documentation (#11313)
Summary:
1. Add documentation to Linear and improve documentation for RNNs
2. Fix preprocessing in C++ docs by adding correct include path
3. Make myself and ebetica codeowner of docs/cpp to improve development speed

ebetica ezyang soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11313

Differential Revision: D9683615

Pulled By: goldsborough

fbshipit-source-id: 84ea32f9ea6b4060744aabbf5db368776a30f0b5
2018-09-06 12:28:17 -07:00
c43187291c Small fixes to cppdocs for sync script (#11300)
Summary:
I'm setting up an automatic sync job for cppdocs and need two fixes to the cpp docs config:

1. Right now the cppdocs use the `torch` package to figure out the version. For C++ docs all I really need from the built package are the generated Tensor.h and Functions.h files. I can actually generate those directly via `aten/src/ATen/gen.py`, so I can skip building PyTorch altogether and save 10 minutes in the sync job! For this I need to avoid using the torch package in the docs.
2. Internal proxy issues prevent using the git link for sphinx_rtd_theme. We can just use the pip package for the cppdocs (not for the normal PyTorch docs)

soumith ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11300

Differential Revision: D9667193

Pulled By: goldsborough

fbshipit-source-id: 5567e0b3d3bdce03f5856babdb4ff76bcee91846
2018-09-05 16:40:47 -07:00
e6d6aed12e Check doxygen output in travis (#11124)
Summary:
This PR adds a .travis.yml check for our C++ documentation. The goal is to avoid any documentation/comments in our C++ code that would break the doxygen output and possibly ruin the C++ documentation site (currently https://pytorch.org/cppdocs).

For this, we:
1. Run doxygen and record any warnings,
2. Filter out some known bogus warnings,
3. Count the remaining warnings,
4. Fail the check if (3) is non-zero.

soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11124

Differential Revision: D9651011

Pulled By: goldsborough

fbshipit-source-id: 30f776d23bb6d6c482c54db32828b4b99547e87b
2018-09-05 10:25:56 -07:00
f0d3fda064 Improve docs for torch::nn::Module (#11115)
Summary:
Added some documentation. Will rebuild docs to make sure it looks good. Can already accept approvals.

ebetica apaszke ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11115

Differential Revision: D9597880

Pulled By: goldsborough

fbshipit-source-id: 56b701da631702ba56e281a0de0f7ebe490f5c5a
2018-09-04 18:10:38 -07:00