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
1af98901
Commit
1af98901
authored
Jul 08, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see if rtd works better
parent
9d83d921
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
docs/conf.py
docs/conf.py
+2
-1
tensorpack/models/_common.py
tensorpack/models/_common.py
+10
-3
tensorpack/tfutils/modelutils.py
tensorpack/tfutils/modelutils.py
+1
-1
No files found.
docs/conf.py
View file @
1af98901
...
...
@@ -34,7 +34,8 @@ import mock
#+ ', '.join(["{}={}".format(k,v) for k,v in kwargs.items()]) + ')'
MOCK_MODULES
=
[
'numpy'
,
'scipy'
,
'tensorflow'
,
'scipy.misc'
,
'h5py'
,
'nltk'
,
'cv2'
,
'scipy.io'
,
'dill'
,
'zmq'
]
'cv2'
,
'scipy.io'
,
'dill'
,
'zmq'
,
'subprocess32'
,
'lmdb'
,
'tornado'
]
for
mod_name
in
MOCK_MODULES
:
sys
.
modules
[
mod_name
]
=
mock
.
Mock
(
name
=
mod_name
)
...
...
tensorpack/models/_common.py
View file @
1af98901
...
...
@@ -5,8 +5,7 @@
import
tensorflow
as
tf
from
functools
import
wraps
import
six
import
copy
#from decorator import decorator
import
copy
,
os
from
..tfutils
import
*
from
..tfutils.modelutils
import
*
...
...
@@ -31,7 +30,8 @@ def layer_register(summary_activation=False, log_shape=True):
Can be overriden when creating the layer.
:param log_shape: log input/output shape of this layer
"""
#@decorator only enable me when building docs.
def
wrapper
(
func
):
@
wraps
(
func
)
def
wrapped_func
(
name
,
inputs
,
*
args
,
**
kwargs
):
...
...
@@ -69,6 +69,13 @@ def layer_register(summary_activation=False, log_shape=True):
return
outputs
wrapped_func
.
f
=
func
# attribute to access the underlining function object
return
wrapped_func
# need some special handling for RTD to work with the arguments
on_rtd
=
os
.
environ
.
get
(
'READTHEDOCS'
)
==
'True'
if
on_rtd
:
from
decorator
import
decorator
wrapper
=
decorator
(
wrapper
)
return
wrapper
def
shape2d
(
a
):
...
...
tensorpack/tfutils/modelutils.py
View file @
1af98901
...
...
@@ -18,7 +18,7 @@ def describe_model():
msg
.
append
(
"{}: shape={}, dim={}"
.
format
(
v
.
name
,
shape
.
as_list
(),
ele
))
size_mb
=
total
*
4
/
1024.0
**
2
msg
.
append
(
"Total param={} ({:01f} MB)"
.
format
(
total
,
size_mb
))
msg
.
append
(
"Total param={} ({:01f} MB
assuming all float32
)"
.
format
(
total
,
size_mb
))
logger
.
info
(
"Model Params: {}"
.
format
(
'
\n
'
.
join
(
msg
)))
...
...
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