Checkpointable: Have RNN wrappers add their cells as dependencies
authorAllen Lavoie <allenl@google.com>
Fri, 11 May 2018 01:28:24 +0000 (18:28 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 11 May 2018 01:30:54 +0000 (18:30 -0700)
commit56b46370ba08c76200711f4a8d25194af1235fd5
treee9d4a9822884671935a2047059624eaab5d0580a
parent5cef54072782a9a893eda69bec30fcf79cd0086b
Checkpointable: Have RNN wrappers add their cells as dependencies

Also marks _SlimRNNCell as not checkpointable, and adds a more convenient way to tag such classes.

Ideally adding a wrapper around a cell wouldn't break a checkpoint. This could look like RNN cell wrappers inheriting the dependencies of the cell they're wrapping. Possible to add that later if there's demand, or users can just add a dependency on wrapper._cell in addition to/instead of the wrapper when modifying programs.

Fixes #19208.

PiperOrigin-RevId: 196202366
tensorflow/contrib/rnn/python/kernel_tests/core_rnn_cell_test.py
tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py
tensorflow/python/ops/rnn_cell_impl.py
tensorflow/python/training/checkpointable.py
tensorflow/python/training/checkpointable_utils.py
tensorflow/python/training/checkpointable_utils_test.py