Getter for `_num_elements`.
| 620 | |
| 621 | // Getter for `_num_elements`. |
| 622 | static PyObject* EagerTensor_num_elements(EagerTensor* self) { |
| 623 | auto handle = self->handle; |
| 624 | int n = TFE_TensorHandleNumElements(handle, self->status); |
| 625 | if (MaybeRaiseExceptionFromTFStatus(self->status, PyExc_ValueError)) { |
| 626 | // Cleanup self->status before returning. |
| 627 | TF_SetStatus(self->status, TF_OK, ""); |
| 628 | return nullptr; |
| 629 | } |
| 630 | return PyLong_FromLongLong(n); |
| 631 | } |
| 632 | |
| 633 | static PyObject* EagerTensor_tensor_handle(EagerTensor* self, void* unused) { |
| 634 | Py_INCREF(self->handle_data); |
nothing calls this directly
no test coverage detected