MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EagerTensor_num_elements

Function EagerTensor_num_elements

tensorflow/python/eager/pywrap_tensor.cc:622–631  ·  view source on GitHub ↗

Getter for `_num_elements`.

Source from the content-addressed store, hash-verified

620
621// Getter for `_num_elements`.
622static 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
633static PyObject* EagerTensor_tensor_handle(EagerTensor* self, void* unused) {
634 Py_INCREF(self->handle_data);

Callers

nothing calls this directly

Calls 3

TF_SetStatusFunction · 0.85

Tested by

no test coverage detected