MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TFE_Py_TapeSetNew

Function TFE_Py_TapeSetNew

tensorflow/python/eager/pywrap_tfe_src.cc:1512–1522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1510}
1511
1512PyObject* TFE_Py_TapeSetNew(PyObject* persistent,
1513 PyObject* watch_accessed_variables) {
1514 TFE_Py_Tape_Type.tp_new = PyType_GenericNew;
1515 if (PyType_Ready(&TFE_Py_Tape_Type) < 0) return nullptr;
1516 TFE_Py_Tape* tape = PyObject_NEW(TFE_Py_Tape, &TFE_Py_Tape_Type);
1517 tape->tape = new GradientTape(persistent == Py_True,
1518 watch_accessed_variables == Py_True);
1519 Py_INCREF(tape);
1520 GetTapeSet()->insert(reinterpret_cast<TFE_Py_Tape*>(tape));
1521 return reinterpret_cast<PyObject*>(tape);
1522}
1523
1524void TFE_Py_TapeSetAdd(PyObject* tape) {
1525 Py_INCREF(tape);

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected