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

Method next

tensorflow/python/util/util.cc:383–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381 }
382
383 Safe_PyObjectPtr next() override {
384 Safe_PyObjectPtr result;
385 Safe_PyObjectPtr key(PyIter_Next(iter_.get()));
386 if (key) {
387 // Unlike PyDict_GetItem, PyObject_GetItem returns a new reference.
388 PyObject* elem = PyObject_GetItem(mapping_, key.get());
389 if (elem) {
390 result.reset(elem);
391 } else {
392 PyErr_SetString(PyExc_RuntimeError,
393 "Mapping was modified during iteration over it");
394 }
395 }
396 return result;
397 }
398
399 private:
400 PyObject* mapping_;

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected