Skip to content

Commit

Permalink
apidoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwwyyxx committed Apr 25, 2016
1 parent fd21c3b commit 3164613
Show file tree
Hide file tree
Showing 13 changed files with 595 additions and 4 deletions.
26 changes: 23 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,31 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys, os, re

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../'))

import mock

#class AttrMock(mock.Mock):
#def __init__(self, name):
#self.__dict__['name'] = name
#def __getattr__(self, attr):
#return AttrMock(self.__dict__['name'] + "." + attr)
#def __str__(self):
#return self.__dict__['name']
#def __call__(self, *args, **kwargs):
#return self.__dict__['name'] + '(' + \
#', '.join(map(str, args)) + ', ' \
#+ ', '.join(["{}={}".format(k,v) for k,v in kwargs.items()]) + ')'

MOCK_MODULES = ['numpy', 'scipy', 'tensorflow', 'scipy.misc', 'h5py', 'nltk',
'cv2', 'scipy.io']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()
sys.modules[mod_name] = mock.Mock(name=mod_name)

import tensorpack
from tensorpack.models import *
Expand Down Expand Up @@ -301,5 +313,13 @@ def skip(app, what, name, obj, skip, options):
return False
return skip

def get_rst(app, what, name, obj, options, signature,
return_annotation):
if signature:
signature = re.sub('<Mock name=\'([^\']+)\'.*>', '\g<1>', signature)
signature = re.sub('tensorflow', 'tf')
return signature, return_annotation

def setup(app):
app.connect('autodoc-process-signature', get_rst)
app.connect("autodoc-skip-member", skip)
7 changes: 7 additions & 0 deletions docs/modules/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tensorpack
==========

.. toctree::
:maxdepth: 10

tensorpack
70 changes: 70 additions & 0 deletions docs/modules/tensorpack.callbacks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
tensorpack.callbacks package
============================

Submodules
----------

tensorpack.callbacks.base module
--------------------------------

.. automodule:: tensorpack.callbacks.base
:members:
:undoc-members:
:show-inheritance:

tensorpack.callbacks.common module
----------------------------------

.. automodule:: tensorpack.callbacks.common
:members:
:undoc-members:
:show-inheritance:

tensorpack.callbacks.dump module
--------------------------------

.. automodule:: tensorpack.callbacks.dump
:members:
:undoc-members:
:show-inheritance:

tensorpack.callbacks.group module
---------------------------------

.. automodule:: tensorpack.callbacks.group
:members:
:undoc-members:
:show-inheritance:

tensorpack.callbacks.inference module
-------------------------------------

.. automodule:: tensorpack.callbacks.inference
:members:
:undoc-members:
:show-inheritance:

tensorpack.callbacks.param module
---------------------------------

.. automodule:: tensorpack.callbacks.param
:members:
:undoc-members:
:show-inheritance:

tensorpack.callbacks.summary module
-----------------------------------

.. automodule:: tensorpack.callbacks.summary
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: tensorpack.callbacks
:members:
:undoc-members:
:show-inheritance:
54 changes: 54 additions & 0 deletions docs/modules/tensorpack.dataflow.dataset.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
tensorpack.dataflow.dataset package
===================================

Submodules
----------

tensorpack.dataflow.dataset.cifar10 module
------------------------------------------

.. automodule:: tensorpack.dataflow.dataset.cifar10
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.dataset.ilsvrc module
-----------------------------------------

.. automodule:: tensorpack.dataflow.dataset.ilsvrc
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.dataset.mnist module
----------------------------------------

.. automodule:: tensorpack.dataflow.dataset.mnist
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.dataset.svhn module
---------------------------------------

.. automodule:: tensorpack.dataflow.dataset.svhn
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.dataset.visualqa module
-------------------------------------------

.. automodule:: tensorpack.dataflow.dataset.visualqa
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: tensorpack.dataflow.dataset
:members:
:undoc-members:
:show-inheritance:
62 changes: 62 additions & 0 deletions docs/modules/tensorpack.dataflow.imgaug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
tensorpack.dataflow.imgaug package
==================================

Submodules
----------

tensorpack.dataflow.imgaug.base module
--------------------------------------

.. automodule:: tensorpack.dataflow.imgaug.base
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.imgaug.crop module
--------------------------------------

.. automodule:: tensorpack.dataflow.imgaug.crop
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.imgaug.deform module
----------------------------------------

.. automodule:: tensorpack.dataflow.imgaug.deform
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.imgaug.imgproc module
-----------------------------------------

.. automodule:: tensorpack.dataflow.imgaug.imgproc
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.imgaug.noname module
----------------------------------------

.. automodule:: tensorpack.dataflow.imgaug.noname
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.imgaug.paste module
---------------------------------------

.. automodule:: tensorpack.dataflow.imgaug.paste
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: tensorpack.dataflow.imgaug
:members:
:undoc-members:
:show-inheritance:
70 changes: 70 additions & 0 deletions docs/modules/tensorpack.dataflow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
tensorpack.dataflow package
===========================

Subpackages
-----------

.. toctree::

tensorpack.dataflow.dataset
tensorpack.dataflow.imgaug

Submodules
----------

tensorpack.dataflow.base module
-------------------------------

.. automodule:: tensorpack.dataflow.base
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.common module
---------------------------------

.. automodule:: tensorpack.dataflow.common
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.dftools module
----------------------------------

.. automodule:: tensorpack.dataflow.dftools
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.format module
---------------------------------

.. automodule:: tensorpack.dataflow.format
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.image module
--------------------------------

.. automodule:: tensorpack.dataflow.image
:members:
:undoc-members:
:show-inheritance:

tensorpack.dataflow.prefetch module
-----------------------------------

.. automodule:: tensorpack.dataflow.prefetch
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: tensorpack.dataflow
:members:
:undoc-members:
:show-inheritance:
78 changes: 78 additions & 0 deletions docs/modules/tensorpack.models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
tensorpack.models package
=========================

Submodules
----------

tensorpack.models.batch_norm module
-----------------------------------

.. automodule:: tensorpack.models.batch_norm
:members:
:undoc-members:
:show-inheritance:

tensorpack.models.conv2d module
-------------------------------

.. automodule:: tensorpack.models.conv2d
:members:
:undoc-members:
:show-inheritance:

tensorpack.models.fc module
---------------------------

.. automodule:: tensorpack.models.fc
:members:
:undoc-members:
:show-inheritance:

tensorpack.models.image_sample module
-------------------------------------

.. automodule:: tensorpack.models.image_sample
:members:
:undoc-members:
:show-inheritance:

tensorpack.models.model_desc module
-----------------------------------

.. automodule:: tensorpack.models.model_desc
:members:
:undoc-members:
:show-inheritance:

tensorpack.models.nonlin module
-------------------------------

.. automodule:: tensorpack.models.nonlin
:members:
:undoc-members:
:show-inheritance:

tensorpack.models.pool module
-----------------------------

.. automodule:: tensorpack.models.pool
:members:
:undoc-members:
:show-inheritance:

tensorpack.models.regularize module
-----------------------------------

.. automodule:: tensorpack.models.regularize
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: tensorpack.models
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 3164613

Please sign in to comment.