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

Function PyEagerTensor_NumElements

tensorflow/python/eager/pywrap_tensor.cc:934–949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934tensorflow::int64 PyEagerTensor_NumElements(const PyObject* tensor) {
935 DCHECK(EagerTensor_CheckExact(tensor));
936 const EagerTensor* as_c_eager_tensor =
937 reinterpret_cast<const EagerTensor*>(tensor);
938 tensorflow::int64 result = TFE_TensorHandleNumElements(
939 as_c_eager_tensor->handle, as_c_eager_tensor->status);
940
941 if (MaybeRaiseExceptionFromTFStatus(as_c_eager_tensor->status,
942 PyExc_ValueError)) {
943 // Cleanup status before returning.
944 TF_SetStatus(as_c_eager_tensor->status, TF_OK, "");
945 return -1;
946 }
947
948 return result;
949}
950
951PyObject* TFE_Py_InitEagerTensor(PyObject* base_class) {
952 if (!PyType_Check(base_class)) {

Callers 1

NumElementsMethod · 0.85

Calls 3

TF_SetStatusFunction · 0.85

Tested by

no test coverage detected