未验证 提交 6074c50a 编写于 作者: Q Qi Li 提交者: GitHub

[cusotm device] add python inference api, test=develop (#46460)

上级 e1a1c354
......@@ -367,7 +367,7 @@ struct PD_INFER_DECL AnalysisConfig {
///
/// \param device_id device_id the custom device to use (default is 0).
///
void EnableCustomDevice(const std::string& device_type, int device_id);
void EnableCustomDevice(const std::string& device_type, int device_id = 0);
///
/// \brief Turn on ONNXRuntime.
///
......
......@@ -662,6 +662,10 @@ void BindAnalysisConfig(py::module *m) {
.def("set_xpu_device_id",
&AnalysisConfig::SetXpuDeviceId,
py::arg("device_id") = 0)
.def("enable_custom_device",
&AnalysisConfig::EnableCustomDevice,
py::arg("device_type"),
py::arg("device_id") = 0)
.def("enable_npu", &AnalysisConfig::EnableNpu, py::arg("device_id") = 0)
.def("enable_ipu",
&AnalysisConfig::EnableIpu,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册