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
d89b6f07
Commit
d89b6f07
authored
Mar 14, 2020
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use TowerHandle.get_tensor to access variables (fix #1409)
parent
6f0ba596
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
examples/DynamicFilterNetwork/steering-filter.py
examples/DynamicFilterNetwork/steering-filter.py
+1
-0
tensorpack/tfutils/tower.py
tensorpack/tfutils/tower.py
+4
-3
No files found.
examples/DynamicFilterNetwork/steering-filter.py
View file @
d89b6f07
...
...
@@ -12,6 +12,7 @@ from scipy.signal import convolve2d
from
tensorpack
import
*
from
tensorpack.dataflow
import
dataset
from
tensorpack.utils
import
logger
from
tensorpack.utils.gpu
import
change_gpu
from
tensorpack.utils.argtools
import
shape2d
,
shape4d
from
tensorpack.utils.viz
import
*
...
...
tensorpack/tfutils/tower.py
View file @
d89b6f07
...
...
@@ -385,9 +385,9 @@ class TowerTensorHandle(object):
def
get_tensor
(
self
,
name
):
"""
Get a tensor in this tower. The name can be:
Get a tensor in this tower. The name
argument
can be:
1. The name of
the tensor
without any tower prefix.
1. The name of
a tensor/variable
without any tower prefix.
2. A name in the input signature, if it is used when building the tower.
...
...
@@ -405,7 +405,6 @@ class TowerTensorHandle(object):
except
KeyError
:
if
name
in
self
.
_extra_tensor_names
:
return
self
.
_extra_tensor_names
[
name
]
raise
else
:
if
name
in
self
.
_extra_tensor_names
:
mapped_tensor
=
self
.
_extra_tensor_names
[
name
]
...
...
@@ -415,6 +414,8 @@ class TowerTensorHandle(object):
" Assuming it is the input '{}'."
.
format
(
mapped_tensor
.
name
))
return
mapped_tensor
return
ret
# should also allow variables in get_tensor
return
self
.
get_variable
(
name
)
def
get_tensors
(
self
,
names
):
"""
...
...
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