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

Function IsMappingHelper

tensorflow/python/util/util.cc:216–222  ·  view source on GitHub ↗

Returns 1 if `o` is considered a mapping for the purposes of Flatten(). Returns 0 otherwise. Returns -1 if an error occurred.

Source from the content-addressed store, hash-verified

214// Returns 0 otherwise.
215// Returns -1 if an error occurred.
216int IsMappingHelper(PyObject* o) {
217 static auto* const check_cache = new CachedTypeCheck([](PyObject* to_check) {
218 return IsInstanceOfRegisteredType(to_check, "Mapping");
219 });
220 if (PyDict_Check(o)) return true;
221 return check_cache->CachedLookup(o);
222}
223
224// Returns 1 if `o` is considered a mapping view for the purposes of Flatten().
225// Returns 0 otherwise.

Callers 5

IsSequenceHelperFunction · 0.85
GetValueIteratorFunction · 0.85
GetValueIteratorForDataFunction · 0.85
IsMappingFunction · 0.85

Calls 2

CachedLookupMethod · 0.80

Tested by

no test coverage detected