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

Function GetOpDef

tensorflow/python/eager/pywrap_tfe_src.cc:2780–2797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2778}
2779
2780const tensorflow::OpDef* GetOpDef(PyObject* py_op_name) {
2781 const char* op_name = TFE_GetPythonString(py_op_name);
2782 if (op_name == nullptr) {
2783 PyErr_SetString(PyExc_TypeError,
2784 Printf("expected a string for op_name, got %s instead",
2785 py_op_name->ob_type->tp_name)
2786 .c_str());
2787 return nullptr;
2788 }
2789
2790 const tensorflow::OpRegistrationData* op_reg_data = nullptr;
2791 const tensorflow::Status lookup_status =
2792 tensorflow::OpRegistry::Global()->LookUp(op_name, &op_reg_data);
2793 if (MaybeRaiseExceptionFromStatus(lookup_status, nullptr)) {
2794 return nullptr;
2795 }
2796 return &op_reg_data->op_def;
2797}
2798
2799const char* GetDeviceName(PyObject* py_device_name) {
2800 if (py_device_name != Py_None) {

Callers 1

TFE_Py_FastPathExecute_CFunction · 0.70

Calls 5

TFE_GetPythonStringFunction · 0.85
PrintfFunction · 0.85
c_strMethod · 0.80
LookUpMethod · 0.45

Tested by

no test coverage detected