示例#1
0
 def _push_tape(self):
   if self._recording:
     raise ValueError("Tape is already recording.")
   if self._tape is None:
     self._tape = tape.push_new_tape(
         persistent=self._persistent,
         watch_accessed_variables=self._watch_accessed_variables)
   else:
     tape.push_tape(self._tape)
   self._recording = True
示例#2
0
 def _push_tape(self, existing_tape=False):
   if self._recording:
     raise ValueError("Tape is already recording.")
   if existing_tape:
     if self._tape is None:
       raise ValueError("There is no existing tape.")
     tape.push_tape(self._tape)
   else:
     self._tape = tape.push_new_tape(persistent=self._persistent)
   self._recording = True
示例#3
0
 def _push_tape(self):
     if self._recording:
         raise ValueError("Tape is already recording.")
     if self._tape is None:
         self._tape = tape.push_new_tape(
             persistent=self._persistent,
             watch_accessed_variables=self._watch_accessed_variables)
     else:
         tape.push_tape(self._tape)
     self._recording = True
示例#4
0
 def _push_tape(self):
   """Pushes a new tape onto the tape stack."""
   if self._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,
         watch_accessed_variables=self._watch_accessed_variables)
   else:
     tape.push_tape(self._tape)
   self._recording = True
示例#5
0
 def _push_tape(self, existing_tape=False):
     if self._recording:
         raise ValueError("Tape is already recording.")
     if existing_tape:
         if self._tape is None:
             raise ValueError("There is no existing tape.")
         tape.push_tape(self._tape)
     else:
         self._tape = tape.push_new_tape(
             persistent=self._persistent,
             watch_accessed_variables=self._watch_accessed_variables)
     self._recording = True