| 398 | } |
| 399 | |
| 400 | static PyObject* PyTensorObject_data_ptr(PyObject* self, PyObject* unused) { |
| 401 | HANDLE_ERRORS |
| 402 | const auto& t = PyTensor_Unpack(self); |
| 403 | const std::shared_ptr<LocalTensor> local_tensor = |
| 404 | t->is_local() ? ASSERT_PTR(t->AsLocalTensor()) : ASSERT_PTR(t->cur_rank_phy_tensor()); |
| 405 | return functional::CastToPyObject( |
| 406 | reinterpret_cast<int64_t>(ASSERT(GetTensorDataPtr(local_tensor)))); |
| 407 | END_HANDLE_ERRORS |
| 408 | } |
| 409 | |
| 410 | static PyObject* PyTensorObject_to_numpy(PyObject* self, PyObject* unused) { |
| 411 | HANDLE_ERRORS |
nothing calls this directly
no test coverage detected