| 1594 | } |
| 1595 | |
| 1596 | bool TapeCouldPossiblyRecord(PyObject* tensors) { |
| 1597 | if (tensors == Py_None) { |
| 1598 | return false; |
| 1599 | } |
| 1600 | if (*ThreadTapeIsStopped()) { |
| 1601 | return false; |
| 1602 | } |
| 1603 | if (!HasTape()) { |
| 1604 | return false; |
| 1605 | } |
| 1606 | return true; |
| 1607 | } |
| 1608 | |
| 1609 | PyObject* TFE_Py_TapeSetShouldRecord(PyObject* tensors) { |
| 1610 | if (!TapeCouldPossiblyRecord(tensors)) { |
no test coverage detected