| 481 | }; |
| 482 | |
| 483 | bool IsSparseTensorValueType(PyObject* o) { |
| 484 | PyObject* sparse_tensor_value_type = GetRegisteredType("SparseTensorValue"); |
| 485 | if (TF_PREDICT_FALSE(sparse_tensor_value_type == nullptr)) { |
| 486 | return false; |
| 487 | } |
| 488 | |
| 489 | return PyObject_TypeCheck( |
| 490 | o, reinterpret_cast<PyTypeObject*>(sparse_tensor_value_type)) == 1; |
| 491 | } |
| 492 | |
| 493 | // Returns 1 if `o` is an instance of CompositeTensor. |
| 494 | // Returns 0 otherwise. |
no test coverage detected