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

Function ConvertOneBool

tensorflow/python/lib/core/py_seq_tensor.cc:489–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487// Bool support
488
489const char* ConvertOneBool(PyObject* v, bool* out) {
490 if (v == Py_True) {
491 *out = true;
492 } else if (v == Py_False) {
493 *out = false;
494 } else if (PyIsInstance(v, &PyBoolArrType_Type)) { // NumPy
495 *out = PyObject_IsTrue(v);
496 } else {
497 return ErrorMixedTypes;
498 }
499 return nullptr;
500}
501
502DEFINE_HELPER(ConvertBool, bool, DT_BOOL, ConvertOneBool);
503

Callers

nothing calls this directly

Calls 1

PyIsInstanceFunction · 0.85

Tested by

no test coverage detected