Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
13530934
baselines
Commits
91b10857
Commit
91b10857
authored
Jun 28, 2017
by
MironencoMircea
Browse files
Fixed TF graph variables deprecation
parent
0778e9f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
baselines/common/tf_util.py
View file @
91b10857
...
...
@@ -526,7 +526,7 @@ class Module(object):
@
property
def
variables
(
self
):
assert
self
.
scope
is
not
None
,
"need to call module once before getting variables"
return
tf
.
get_collection
(
tf
.
GraphKeys
.
VARIABLES
,
self
.
scope
)
return
tf
.
get_collection
(
tf
.
GraphKeys
.
GLOBAL_
VARIABLES
,
self
.
scope
)
def
module
(
name
):
...
...
@@ -681,7 +681,7 @@ def scope_vars(scope, trainable_only=False):
list of variables in `scope`.
"""
return
tf
.
get_collection
(
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
if
trainable_only
else
tf
.
GraphKeys
.
VARIABLES
,
tf
.
GraphKeys
.
TRAINABLE_VARIABLES
if
trainable_only
else
tf
.
GraphKeys
.
GLOBAL_
VARIABLES
,
scope
=
scope
if
isinstance
(
scope
,
str
)
else
scope
.
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