| 460 | } |
| 461 | |
| 462 | TFE_TensorHandle* TFE_NewTensorHandle(TF_Tensor* t, TF_Status* status) { |
| 463 | tensorflow::Tensor tensor; |
| 464 | status->status = tensorflow::TF_TensorToTensor(t, &tensor); |
| 465 | if (!status->status.ok()) return nullptr; |
| 466 | return TFE_TensorHandle::CreateLocalHandle(tensor, status); |
| 467 | } |
| 468 | |
| 469 | void TFE_DeleteTensorHandle(TFE_TensorHandle* h) { |
| 470 | if (h == nullptr) return; |