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
:show-inheritance:
tensorpack.utils.rect module
----------------------------
.. automodule:: tensorpack.utils.rect
:members:
:undoc-members:
:show-inheritance:
tensorpack.utils.serialize module
---------------------------------
......
......@@ -4,7 +4,7 @@
import tensorflow as tf
__all__ = ['StaticDynamicAxis', 'StaticDynamicShape']
__all__ = []
class StaticDynamicAxis(object):
......
......@@ -7,7 +7,7 @@ import six
import argparse
from . import logger
__all__ = ['globalns']
__all__ = ['globalns', 'GlobalNS']
if six.PY2:
class NS:
......@@ -17,7 +17,12 @@ else:
NS = types.SimpleNamespace
class MyNS(NS):
# TODO make it singleton
class GlobalNS(NS):
"""
The class of the globalns instance.
"""
def use_argument(self, args):
"""
Add the content of :class:`argparse.Namespace` to this ns.
......@@ -32,4 +37,17 @@ class MyNS(NS):
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
__all__ = ['change_env',
'get_rng',
'fix_rng_seed',
'get_tqdm_kwargs',
'get_tqdm',
# 'get_tqdm_kwargs',
# 'get_tqdm',
'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