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

Function IsTensorHelper

tensorflow/python/util/util.cc:263–268  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

261// Returns 0 otherwise.
262// Returns -1 if an error occurred.
263int IsTensorHelper(PyObject* o) {
264 static auto* const check_cache = new CachedTypeCheck([](PyObject* to_check) {
265 return IsInstanceOfRegisteredType(to_check, "Tensor");
266 });
267 return check_cache->CachedLookup(o);
268}
269
270// Returns 1 if `o` is a ResourceVariable.
271// Returns 0 otherwise.

Callers 1

IsTensorFunction · 0.85

Calls 2

CachedLookupMethod · 0.80

Tested by

no test coverage detected