summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorThomas Viehmann <tv@beamnet.de>2019-01-29 11:19:51 -0800
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-01-29 12:14:17 -0800
commit6a6983ed7f14f8335a5b5614928713cb79658281 (patch)
treedd24a3d02312c12a62db4dd14dcb59efc077d244 /setup.py
parent3b337e7892a7b54758f273477aa092053f02b410 (diff)
downloadpytorch-6a6983ed7f14f8335a5b5614928713cb79658281.tar.gz
pytorch-6a6983ed7f14f8335a5b5614928713cb79658281.tar.bz2
pytorch-6a6983ed7f14f8335a5b5614928713cb79658281.zip
create type hint stub files for module torch (#12500)
Summary: We have: - This is an initial stab at creating a type stub `torch/__init__.pyi` . - This is only tested on Python 3, since that's the only Python version mypy works on. - So far, we only aim at doing this for torch functions and torch.Tensor. - Quite a few methods and functions have to be typed manually. These are done in `torch/__init__.pyi.in` For me, PyCharm (the non-paid one) didn't seem to indicate errors in the .pyi when opening and seemed to be able to get the type hint for the few functions I tried, but I don't use PyCharm for my usual PyTorch activities, so I didn't extensively try this out. An example of a generated PYI is at [this gist](https://gist.github.com/ezyang/bf9b6a5fa8827c52152858169bcb61b1). Pull Request resolved: https://github.com/pytorch/pytorch/pull/12500 Differential Revision: D13695553 Pulled By: ezyang fbshipit-source-id: 4566c71913ede4e4c23ebc4a72c17151f94e8e21
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 465ed78a39..9b79d79801 100644
--- a/setup.py
+++ b/setup.py
@@ -731,6 +731,7 @@ if __name__ == '__main__':
entry_points=entry_points,
package_data={
'torch': [
+ '__init__.pyi',
'lib/*.so*',
'lib/*.dylib*',
'lib/*.dll',