From 446450369b9f4375cf26c1c1bc3b9a3fd93059f5 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 27 Jul 2017 22:15:58 -0700 Subject: [PATCH] Use identity of param variable in cudnn_rnn.RNNParamsSaveable instead of parameter variable directly. The RNNParamsSaveable is usually used in a graph which also has a saver for the cudnn param variable itself, if the same op is used for both, fails with a two savers for same op error. PiperOrigin-RevId: 163431826 --- tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py b/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py index be5af6900cc..d796107959c 100644 --- a/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py +++ b/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py @@ -132,7 +132,7 @@ class RNNParamsSaveable(saver.BaseSaverBuilder.SaveableObject): for param, param_name in zip(params, param_names) ] super(RNNParamsSaveable, self).__init__( - param_variables[0], specs, name) + array_ops.identity(param_variables[0]), specs, name) def restore(self, restored_tensors, restored_shapes): if (self._cudnn_rnn.direction == CUDNN_RNN_UNIDIRECTION and