| 1522 | } |
| 1523 | |
| 1524 | void TFE_Py_TapeSetAdd(PyObject* tape) { |
| 1525 | Py_INCREF(tape); |
| 1526 | if (!GetTapeSet()->insert(reinterpret_cast<TFE_Py_Tape*>(tape)).second) { |
| 1527 | // Already exists in the tape set. |
| 1528 | Py_DECREF(tape); |
| 1529 | } |
| 1530 | } |
| 1531 | |
| 1532 | PyObject* TFE_Py_TapeSetIsEmpty() { |
| 1533 | if (*ThreadTapeIsStopped() || !HasTape()) { |