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
e63d8b7e
Commit
e63d8b7e
authored
Jul 23, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
34e8d817
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
docs/tutorial/intro.rst
docs/tutorial/intro.rst
+2
-1
docs/tutorial/trainer.md
docs/tutorial/trainer.md
+1
-1
tensorpack/utils/utils.py
tensorpack/utils/utils.py
+16
-3
No files found.
docs/tutorial/intro.rst
View file @
e63d8b7e
...
@@ -15,7 +15,8 @@ The Tensorpack API brings speed and flexibility together.
...
@@ -15,7 +15,8 @@ The Tensorpack API brings speed and flexibility together.
Is TensorFlow Slow?
Is TensorFlow Slow?
~~~~~~~~~~~~~~~~~~~~~
*******************
There is a common misconception,
There is a common misconception,
but no, it's not slow. But it's not easy to write it in an efficient way.
but no, it's not slow. But it's not easy to write it in an efficient way.
...
...
docs/tutorial/trainer.md
View file @
e63d8b7e
...
@@ -55,7 +55,7 @@ The tower function needs to follow some rules:
...
@@ -55,7 +55,7 @@ The tower function needs to follow some rules:
Tensorpack layers create variables based on the name given to the layer:
Tensorpack layers create variables based on the name given to the layer:
e.g., `Conv2D('test', x)` will open a variable scope named "test".
e.g., `Conv2D('test', x)` will open a variable scope named "test".
In order to respect the above rules,
In order to respect the above rules,
the name of the layer must not depend on name_scope's name or any tensor's name.
the name of the layer must not depend on name_scope's name or any tensor's name.
4.
It must __respect variable scope reuse__:
4.
It must __respect variable scope reuse__:
*
The creation of any trainable variables must __respect reuse__ variable scope.
*
The creation of any trainable variables must __respect reuse__ variable scope.
...
...
tensorpack/utils/utils.py
View file @
e63d8b7e
...
@@ -69,17 +69,30 @@ def humanize_time_delta(sec):
...
@@ -69,17 +69,30 @@ def humanize_time_delta(sec):
def
change_env
(
name
,
val
):
def
change_env
(
name
,
val
):
"""
"""
Args:
Args:
name(str), val(str):
name(str): name of the env var
val(str or None): the value, or set to None to clear the env var.
Returns:
Returns:
a context where the environment variable ``name`` being set to
a context where the environment variable ``name`` being set to
``val``. It will be set back after the context exits.
``val``. It will be set back after the context exits.
"""
"""
oldval
=
os
.
environ
.
get
(
name
,
None
)
oldval
=
os
.
environ
.
get
(
name
,
None
)
os
.
environ
[
name
]
=
val
if
val
is
None
:
try
:
del
os
.
environ
[
name
]
except
KeyError
:
pass
else
:
os
.
environ
[
name
]
=
val
yield
yield
if
oldval
is
None
:
if
oldval
is
None
:
del
os
.
environ
[
name
]
try
:
del
os
.
environ
[
name
]
except
KeyError
:
pass
else
:
else
:
os
.
environ
[
name
]
=
oldval
os
.
environ
[
name
]
=
oldval
...
...
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