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

Function ConvertOneComplex

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

Source from the content-addressed store, hash-verified

471// Complex support
472
473const char* ConvertOneComplex(PyObject* v, complex128* out) {
474 if (PyComplex_Check(v)) {
475 *out = complex128(PyComplex_RealAsDouble(v), PyComplex_ImagAsDouble(v));
476 return nullptr;
477 } else if (PyIsInstance(v, &PyComplexFloatingArrType_Type)) { // NumPy
478 auto as_complex = PyComplex_AsCComplex(v);
479 *out = complex128(as_complex.real, as_complex.imag);
480 return nullptr;
481 }
482 return ErrorMixedTypes;
483}
484
485DEFINE_HELPER(ConvertComplex, complex128, DT_COMPLEX128, ConvertOneComplex);
486

Callers

nothing calls this directly

Calls 1

PyIsInstanceFunction · 0.85

Tested by

no test coverage detected