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

Function IsVariableHelper

tensorflow/python/util/util.cc:283–288  ·  view source on GitHub ↗

Returns 1 if `o` is a ResourceVariable. Returns 0 otherwise. Returns -1 if an error occurred.

Source from the content-addressed store, hash-verified

281// Returns 0 otherwise.
282// Returns -1 if an error occurred.
283int IsVariableHelper(PyObject* o) {
284 static auto* const check_cache = new CachedTypeCheck([](PyObject* to_check) {
285 return IsInstanceOfRegisteredType(to_check, "Variable");
286 });
287 return check_cache->CachedLookup(o);
288}
289
290// Returns 1 if `o` is considered a sequence for the purposes of Flatten().
291// Returns 0 otherwise.

Callers 1

IsVariableFunction · 0.85

Calls 2

CachedLookupMethod · 0.80

Tested by

no test coverage detected