Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
cc2df915
Commit
cc2df915
authored
Nov 23, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide something from API docs
parent
bed3fa19
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
6 deletions
+14
-6
docs/conf.py
docs/conf.py
+4
-0
tensorpack/graph_builder/distributed.py
tensorpack/graph_builder/distributed.py
+1
-0
tensorpack/tfutils/tower.py
tensorpack/tfutils/tower.py
+2
-4
tensorpack/train/trainers.py
tensorpack/train/trainers.py
+2
-2
tensorpack/utils/develop.py
tensorpack/utils/develop.py
+5
-0
No files found.
docs/conf.py
View file @
cc2df915
...
...
@@ -353,11 +353,15 @@ def process_signature(app, what, name, obj, options, signature,
return
signature
,
return_annotation
def
autodoc_skip_member
(
app
,
what
,
name
,
obj
,
skip
,
options
):
# we hide something deliberately
if
getattr
(
obj
,
'__HIDE_SPHINX_DOC__'
,
False
):
return
True
if
name
==
'__init__'
:
if
obj
.
__doc__
and
skip
:
# include_init_with_doc doesn't work well for decorated init
# https://github.com/sphinx-doc/sphinx/issues/4258
return
False
# hide deprecated stuff
if
name
in
[
'MultiGPUTrainerBase'
,
'FeedfreeInferenceRunner'
,
...
...
tensorpack/graph_builder/distributed.py
View file @
cc2df915
...
...
@@ -42,6 +42,7 @@ class DistributedReplicatedBuilder(DataParallelBuilder):
server = tf.train.Server(
cluster_spec, job_name=args.job, task_index=args.task,
config=get_default_sess_config())
# initialize trainer with this server object
.. code-block:: none
...
...
tensorpack/tfutils/tower.py
View file @
cc2df915
...
...
@@ -9,6 +9,7 @@ from six.moves import zip
from
..utils
import
logger
from
..utils.argtools
import
call_only_once
from
..utils.naming
import
TRAIN_TOWER_FREEZE_KEYS
,
PREDICT_TOWER_FREEZE_KEYS
from
..utils.develop
import
HIDE_DOC
from
.collection
import
CollectionGuard
from
.common
import
get_tf_version_number
,
get_op_or_tensor_by_name
,
get_op_tensor_name
...
...
@@ -261,11 +262,8 @@ class TowerTensorHandle(object):
inputs/outputs created in each tower.
"""
# TODO hide it from doc
@
HIDE_DOC
def
__init__
(
self
,
ctx
,
input
,
output
,
inputs_desc
=
None
):
"""
Don't use it because you never need to create the handle by yourself.
"""
self
.
_ctx
=
ctx
self
.
_extra_tensor_names
=
{}
...
...
tensorpack/train/trainers.py
View file @
cc2df915
...
...
@@ -10,6 +10,7 @@ from ..tfutils.sesscreate import NewSessionCreator
from
..utils
import
logger
from
..utils.argtools
import
map_arg
from
..utils.develop
import
HIDE_DOC
from
..tfutils
import
get_global_step_var
from
..tfutils.distributed
import
get_distributed_session_creator
from
..tfutils.tower
import
TowerContext
...
...
@@ -144,8 +145,6 @@ class DistributedTrainerReplicated(SingleCostTrainer):
Args:
gpus (list[int]): list of GPU ids.
server (tf.train.Server): the server with ps and workers.
The job_name must be 'worker' because 'ps' job doesn't need to
build any graph.
"""
self
.
server
=
server
self
.
job_name
=
server
.
server_def
.
job_name
...
...
@@ -196,6 +195,7 @@ class DistributedTrainerReplicated(SingleCostTrainer):
callbacks
.
append
(
cb
)
return
callbacks
@
HIDE_DOC
def
initialize
(
self
,
session_creator
,
session_init
):
if
not
isinstance
(
session_creator
,
NewSessionCreator
)
or
\
session_creator
.
user_provided_config
:
...
...
tensorpack/utils/develop.py
View file @
cc2df915
...
...
@@ -122,6 +122,11 @@ def deprecated(text="", eos=""):
return
deprecated_inner
def
HIDE_DOC
(
func
):
func
.
__HIDE_SPHINX_DOC__
=
True
return
func
# Copied from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/util/lazy_loader.py
class
LazyLoader
(
types
.
ModuleType
):
def
__init__
(
self
,
local_name
,
parent_module_globals
,
name
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment