diff options
author | Adam Roberts <adarob@google.com> | 2018-01-11 09:43:22 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-01-11 09:47:06 -0800 |
commit | 0578ee1f652bcad18d5dc7089eab12b6fff60333 (patch) | |
tree | d6d787e59905bc39ab9048c4d6dd4c7d9705060d /tensorflow/contrib/cudnn_rnn | |
parent | 93ff0aa2dbbae7cc8a253268f324e320d9c7246c (diff) |
Appropriately handle building of CudnnRNN if variable scope has tf.AUTO_REUSE type.
PiperOrigin-RevId: 181620379
Diffstat (limited to 'tensorflow/contrib/cudnn_rnn')
-rw-r--r-- | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py b/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py index 3a21914041..5d640d09b7 100644 --- a/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py +++ b/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py @@ -358,7 +358,7 @@ class _CudnnRNN(base_layer.Layer): # Create saveable in the outer scope of the cudnn subgraph, such that # alternative subgraph with platform-independent rnn cells can load the # checkpoints directly. - if not (self.built or vs.get_variable_scope().reuse): + if not (self.built or vs.get_variable_scope().reuse is True): self._create_saveable() self.built = True @@ -497,7 +497,7 @@ class _CudnnRNN(base_layer.Layer): input_mode=self.input_mode, direction=self.direction, scope=vs.get_variable_scope(), - name="%s_saveable" % self.trainable_variables[0].op.name) + name="%s_saveable" % self.trainable_variables[0].name.split(":")[0]) ops.add_to_collection(ops.GraphKeys.SAVEABLE_OBJECTS, self._saveable) |