Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

fix import __version__ in docs/conf.py

edgarribaf0f499b6cada
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 63bd84dd0..84b714b90 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -119,7 +119,7 @@ Pull Request
============
Once you finish implementing a feature or bug-fix, please send a Pull Request to
-https://github.com/arraiy/torchgeometry through the website.
+https://github.com/arraiyopensource/torchgeometry through the website.
If you are not familiar with creating a Pull Request, here are some guides:
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 2e5170ab3..76fddc514 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,4 +1,6 @@
-import torchgeometry
+import os
+import sys
+
import sphinx_rtd_theme
@@ -50,13 +52,17 @@ author = u'Arraiy, Inc.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
-#
-# The short X.Y version.
-# TODO: change to [:2] at v1.0
-version = 'master (' + torchgeometry.__version__ + ' )'
-# The full version, including alpha/beta/rc tags.
-# TODO: verify this works as expected
-release = 'master'
+
+#version = 'master (' + torchgeometry.__version__ + ' )'
+version = ''
+
+if 'READTHEDOCS' not in os.environ:
+ # if developing locally, use pyro.__version__ as version
+ from torchgeometry import __version__ # noqaE402
+ version = __version__
+
+#release = 'master'
+release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -76,6 +82,8 @@ pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
+# do not prepend module name to functions
+add_module_names = False
# -- Options for HTML output ----------------------------------------------
@@ -140,8 +148,8 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'pytorch.tex', 'torchgeometry Documentation',
- 'Arraiy', 'manual'),
+ (master_doc, 'PytorchGeometry.tex', u'PyTorch Geometry Documentation',
+ u'Arraiy', 'manual'),
]
@@ -150,7 +158,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, 'torchgeometry', 'torchgeometry Documentation',
+ (master_doc, 'PyTorch Geometry', 'PyTorch Geometry Documentation',
[author], 1)
]
@@ -169,8 +177,9 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
- 'python': ('https://docs.python.org/', None),
+ 'python': ('https://docs.python.org/3/', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
+ 'torch': ('http://pytorch.org/docs/master/', None),
}
# -- A patch that prevents Sphinx from cross-referencing ivar tags -------
@@ -225,3 +234,11 @@ def patched_make_field(self, types, domain, items, **kw):
TypedField.make_field = patched_make_field
+
+# @jpchen's hack to get rtd builder to install latest pytorch
+if 'READTHEDOCS' in os.environ:
+ os.system('pip install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp27-cp27mu-linux_x86_64.whl')
+ # for pytorch 1.0 (currently fails with OOM
+ # https://readthedocs.org/projects/pyro-ppl/builds/8159615/
+ # os.system('pip install torch_nightly==1.0.0.dev20181127 -f '
+ # 'https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html')
diff --git a/torchgeometry/imgwarp.py b/torchgeometry/imgwarp.py
index b6f1f1a6c..57a5e66ed 100644
--- a/torchgeometry/imgwarp.py
+++ b/torchgeometry/imgwarp.py
@@ -71,7 +71,7 @@ def warp_perspective(src, M, dsize, flags='bilinear', border_mode=None,
\right )
Args:
- src (Tensor): input image.
+ src (torch.Tensor): input image.
M (Tensor): transformation matrix.
dsize (tuple): size of the output image (height, width).