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

Function MakeTensorIDList

tensorflow/python/eager/pywrap_tfe_src.cc:1764–1782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1762}
1763
1764std::vector<tensorflow::int64> MakeTensorIDList(PyObject* tensors) {
1765 PyObject* seq = PySequence_Fast(tensors, "expected a sequence");
1766 if (seq == nullptr) {
1767 return {};
1768 }
1769 int len = PySequence_Fast_GET_SIZE(seq);
1770 std::vector<tensorflow::int64> list;
1771 list.reserve(len);
1772 for (int i = 0; i < len; ++i) {
1773 PyObject* tensor = PySequence_Fast_GET_ITEM(seq, i);
1774 list.push_back(FastTensorId(tensor));
1775 if (PyErr_Occurred()) {
1776 Py_DECREF(seq);
1777 return list;
1778 }
1779 }
1780 Py_DECREF(seq);
1781 return list;
1782}
1783
1784void TFE_Py_TapeVariableAccessed(PyObject* variable) {
1785 if (*ThreadTapeIsStopped()) {

Callers 3

TFE_Py_TapeGradientFunction · 0.85
RecordGradientFunction · 0.85

Calls 3

FastTensorIdFunction · 0.85
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected