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

Function PySeqToTFE_TensorHandle

tensorflow/python/eager/pywrap_tensor.cc:253–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253TFE_TensorHandle* PySeqToTFE_TensorHandle(PyObject* value, DataType dtype) {
254 tensorflow::TensorHandle* handle = nullptr;
255 tensorflow::Tensor t;
256 // TODO(josh11b): Have PySeqToTensor set python errors instead of
257 // returning Status.
258 auto cppstatus = tensorflow::PySeqToTensor(value, dtype, &t);
259 if (cppstatus.ok()) {
260 cppstatus = tensorflow::TensorHandle::CreateLocalHandle(t, &handle);
261 }
262 if (!cppstatus.ok()) {
263 PyErr_SetString(PyExc_ValueError, cppstatus.error_message().c_str());
264 return nullptr;
265 }
266 CHECK_NE(handle, nullptr);
267 return new TFE_TensorHandle(handle);
268}
269
270TFE_TensorHandle* ConvertToEagerTensorUncached(TFE_Context* ctx,
271 PyObject* value,

Callers 1

Calls 3

PySeqToTensorFunction · 0.85
c_strMethod · 0.80
okMethod · 0.45

Tested by

no test coverage detected