Update error message in push tape.

PiperOrigin-RevId: 267436813
This commit is contained in:
Zhenyu Tan 2019-09-05 13:12:29 -07:00 committed by TensorFlower Gardener
parent 3a5371dd1c
commit c3339328ea

View File

@ -816,8 +816,10 @@ class GradientTape(object):
self._pop_tape()
def _push_tape(self):
"""Pushes a new tape onto the tape stack."""
if self._recording:
raise ValueError("Tape is already recording.")
raise ValueError("Tape is still recording, This can happen if you try to "
"re-enter an already-active tape.")
if self._tape is None:
self._tape = tape.push_new_tape(
persistent=self._persistent,