fastdeploy_model.cc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #include "ultra_infer/pybind/main.h"
  15. #include "ultra_infer/ultra_infer_model.h"
  16. namespace ultra_infer {
  17. void BindFDModel(pybind11::module &m) {
  18. pybind11::class_<UltraInferModel>(m, "UltraInferModel")
  19. .def(pybind11::init<>(), "Default Constructor")
  20. .def("model_name", &UltraInferModel::ModelName)
  21. .def("num_inputs_of_runtime", &UltraInferModel::NumInputsOfRuntime)
  22. .def("num_outputs_of_runtime", &UltraInferModel::NumOutputsOfRuntime)
  23. .def("input_info_of_runtime", &UltraInferModel::InputInfoOfRuntime)
  24. .def("output_info_of_runtime", &UltraInferModel::OutputInfoOfRuntime)
  25. .def("enable_record_time_of_runtime",
  26. &UltraInferModel::EnableRecordTimeOfRuntime)
  27. .def("disable_record_time_of_runtime",
  28. &UltraInferModel::DisableRecordTimeOfRuntime)
  29. .def("print_statis_info_of_runtime",
  30. &UltraInferModel::PrintStatisInfoOfRuntime)
  31. .def("get_profile_time", &UltraInferModel::GetProfileTime)
  32. .def("initialized", &UltraInferModel::Initialized)
  33. .def_readwrite("runtime_option", &UltraInferModel::runtime_option)
  34. .def_readwrite("valid_cpu_backends", &UltraInferModel::valid_cpu_backends)
  35. .def_readwrite("valid_gpu_backends",
  36. &UltraInferModel::valid_gpu_backends);
  37. }
  38. } // namespace ultra_infer