Getter for `_rank`.
| 605 | |
| 606 | // Getter for `_rank`. |
| 607 | static PyObject* EagerTensor_rank(EagerTensor* self) { |
| 608 | int num_dims = TFE_TensorHandleNumDims(self->handle, self->status); |
| 609 | if (MaybeRaiseExceptionFromTFStatus(self->status, PyExc_ValueError)) { |
| 610 | // Cleanup self->status before returning. |
| 611 | TF_SetStatus(self->status, TF_OK, ""); |
| 612 | return nullptr; |
| 613 | } |
| 614 | #if PY_MAJOR_VERSION < 3 |
| 615 | return PyInt_FromLong(num_dims); |
| 616 | #else |
| 617 | return PyLong_FromLong(num_dims); |
| 618 | #endif |
| 619 | } |
| 620 | |
| 621 | // Getter for `_num_elements`. |
| 622 | static PyObject* EagerTensor_num_elements(EagerTensor* self) { |
nothing calls this directly
no test coverage detected