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
This commit is contained in:
A. Unique TensorFlower 2017-07-27 22:15:58 -07:00 committed by TensorFlower Gardener
parent d629a83165
commit 446450369b

View File

@ -132,7 +132,7 @@ class RNNParamsSaveable(saver.BaseSaverBuilder.SaveableObject):
for param, param_name in zip(params, param_names) for param, param_name in zip(params, param_names)
] ]
super(RNNParamsSaveable, self).__init__( super(RNNParamsSaveable, self).__init__(
param_variables[0], specs, name) array_ops.identity(param_variables[0]), specs, name)
def restore(self, restored_tensors, restored_shapes): def restore(self, restored_tensors, restored_shapes):
if (self._cudnn_rnn.direction == CUDNN_RNN_UNIDIRECTION and if (self._cudnn_rnn.direction == CUDNN_RNN_UNIDIRECTION and