MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / Get

Method Get

paddle/fluid/pybind/python_callable_registry.cc:111–124  ·  view source on GitHub ↗

Return pybind11::object* instead of pybind11::object Returning pybind11::object would cause reference count increasing but without GIL, reference count in Python may not be safe

Source from the content-addressed store, hash-verified

109// Returning pybind11::object would cause reference count increasing
110// but without GIL, reference count in Python may not be safe
111py::object *PythonCallableRegistrar::Get(uint64_t unique_id) {
112 PADDLE_ENFORCE_NE(
113 python_callable_registry_.find(unique_id),
114 python_callable_registry_.end(),
115 common::errors::InvalidArgument(
116 "Unique_id %d is not found in python_callable_registry_. The "
117 "possible "
118 "reasons are below:\n"
119 "1. The python callable was not registered for `unique_id` by "
120 "`PythonCallableRegistrar::Register`\n"
121 "2. The python callable was remove from python_callable_registry_",
122 unique_id));
123 return &(python_callable_registry_[unique_id]);
124}
125
126} // namespace pybind
127} // namespace paddle

Callers 15

CreateVariableIfNotExistFunction · 0.45
ApplyCinnPassFunction · 0.45
ApplyPccPassFunction · 0.45
BindPassManagerFunction · 0.45
BindCustomDevicePyFunction · 0.45
HandleTensorCopyFunction · 0.45
PYBIND11_MODULEFunction · 0.45
GetDenseTensorValueFunction · 0.45
GenerateOpFunctionsFunction · 0.45
ToPyObjectFunction · 0.45

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected