Returns 1 if `o` is a Tensor. Returns 0 otherwise. Returns -1 if an error occurred.
| 261 | // Returns 0 otherwise. |
| 262 | // Returns -1 if an error occurred. |
| 263 | int 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. |
no test coverage detected