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

Function TensorShapeNumDims

tensorflow/python/eager/pywrap_tfe_src.cc:168–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166#endif
167
168Py_ssize_t TensorShapeNumDims(PyObject* value) {
169 const auto size = PySequence_Size(value);
170 if (size == -1) {
171 // TensorShape.__len__ raises an error in the scenario where the shape is an
172 // unknown, which needs to be cleared.
173 // TODO(nareshmodi): ensure that this is actually a TensorShape.
174 PyErr_Clear();
175 }
176 return size;
177}
178
179bool IsInteger(PyObject* py_value) {
180#if PY_MAJOR_VERSION >= 3

Callers 2

SetOpAttrListFunction · 0.85
SetOpAttrScalarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected