| 931 | } |
| 932 | |
| 933 | static tensorflow::int64 FastTensorId(PyObject* tensor) { |
| 934 | if (EagerTensor_CheckExact(tensor)) { |
| 935 | return PyEagerTensor_ID(tensor); |
| 936 | } |
| 937 | PyObject* id_field = PyObject_GetAttrString(tensor, "_id"); |
| 938 | if (id_field == nullptr) { |
| 939 | return -1; |
| 940 | } |
| 941 | tensorflow::int64 id = MakeInt(id_field); |
| 942 | Py_DECREF(id_field); |
| 943 | return id; |
| 944 | } |
| 945 | |
| 946 | static tensorflow::DataType FastTensorDtype(PyObject* tensor) { |
| 947 | if (EagerTensor_CheckExact(tensor)) { |
no test coverage detected