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
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
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
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
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