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

Function ParseInt64Value

tensorflow/python/eager/pywrap_tfe_src.cc:150–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149#if PY_MAJOR_VERSION < 3
150bool ParseInt64Value(const string& key, PyObject* py_value, TF_Status* status,
151 int64_t* value) {
152 if (PyInt_Check(py_value)) {
153 *value = static_cast<int64_t>(PyInt_AsLong(py_value));
154 return true;
155 } else if (PyLong_Check(py_value)) {
156 *value = static_cast<int64_t>(PyLong_AsLong(py_value));
157 return true;
158 }
159 TF_SetStatus(
160 status, TF_INVALID_ARGUMENT,
161 tensorflow::strings::StrCat("Expecting int or long value for attr ", key,
162 ", got ", py_value->ob_type->tp_name)
163 .c_str());
164 return false;
165}
166#endif
167
168Py_ssize_t TensorShapeNumDims(PyObject* value) {

Callers 2

ParseDimensionValueFunction · 0.85
SetOpAttrScalarFunction · 0.85

Calls 3

TF_SetStatusFunction · 0.85
c_strMethod · 0.80
StrCatFunction · 0.50

Tested by

no test coverage detected