Commit 5134338e authored by Yuxin Wu's avatar Yuxin Wu

clean-up docs and imports

parent a0619cd6
...@@ -51,14 +51,6 @@ tensorpack.utils.logger module ...@@ -51,14 +51,6 @@ tensorpack.utils.logger module
:show-inheritance: :show-inheritance:
tensorpack.utils.rect module
----------------------------
.. automodule:: tensorpack.utils.rect
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.serialize module tensorpack.utils.serialize module
--------------------------------- ---------------------------------
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import tensorflow as tf import tensorflow as tf
__all__ = ['StaticDynamicAxis', 'StaticDynamicShape'] __all__ = []
class StaticDynamicAxis(object): class StaticDynamicAxis(object):
......
...@@ -7,7 +7,7 @@ import six ...@@ -7,7 +7,7 @@ import six
import argparse import argparse
from . import logger from . import logger
__all__ = ['globalns'] __all__ = ['globalns', 'GlobalNS']
if six.PY2: if six.PY2:
class NS: class NS:
...@@ -17,7 +17,12 @@ else: ...@@ -17,7 +17,12 @@ else:
NS = types.SimpleNamespace NS = types.SimpleNamespace
class MyNS(NS): # TODO make it singleton
class GlobalNS(NS):
"""
The class of the globalns instance.
"""
def use_argument(self, args): def use_argument(self, args):
""" """
Add the content of :class:`argparse.Namespace` to this ns. Add the content of :class:`argparse.Namespace` to this ns.
...@@ -32,4 +37,17 @@ class MyNS(NS): ...@@ -32,4 +37,17 @@ class MyNS(NS):
setattr(self, k, v) setattr(self, k, v)
globalns = MyNS() globalns = GlobalNS()
"""
A namespace to store global variables.
Examples:
.. code-block:: none
import tensorpack.utils.globalns as G
G.depth = 18
G.batch_size = 1
G.use_argument(parser.parse_args())
"""
...@@ -14,8 +14,8 @@ import numpy as np ...@@ -14,8 +14,8 @@ import numpy as np
__all__ = ['change_env', __all__ = ['change_env',
'get_rng', 'get_rng',
'fix_rng_seed', 'fix_rng_seed',
'get_tqdm_kwargs', # 'get_tqdm_kwargs',
'get_tqdm', # 'get_tqdm',
'execute_only_once', 'execute_only_once',
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment