| 481 | } |
| 482 | |
| 483 | int TFE_TensorHandleNumDims(TFE_TensorHandle* h, TF_Status* status) { |
| 484 | if (h == nullptr || h->handle == nullptr) { |
| 485 | status->status = tensorflow::errors::InvalidArgument( |
| 486 | "The passed in handle is a nullptr"); |
| 487 | return -1; |
| 488 | } |
| 489 | int result; |
| 490 | status->status = h->handle->NumDims(&result); |
| 491 | return result; |
| 492 | } |
| 493 | |
| 494 | int64_t TFE_TensorHandleNumElements(TFE_TensorHandle* h, TF_Status* status) { |
| 495 | if (h == nullptr || h->handle == nullptr) { |