mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-24 00:53:22 +08:00
Add nnadapter pybind and remove useless API
This commit is contained in:
@@ -255,6 +255,11 @@ class RuntimeOption:
|
||||
rknpu2_core=rknpu2.CoreMask.RKNN_NPU_CORE_0):
|
||||
return self._option.use_rknpu2(rknpu2_name, rknpu2_core)
|
||||
|
||||
def use_cann(self):
|
||||
"""Inference with Huawei Ascend NPU
|
||||
"""
|
||||
return self._option.use_cann()
|
||||
|
||||
def set_cpu_thread_num(self, thread_num=-1):
|
||||
"""Set number of threads if inference with CPU
|
||||
|
||||
@@ -309,6 +314,49 @@ class RuntimeOption:
|
||||
"""
|
||||
return self.use_lite_backend()
|
||||
|
||||
def set_lite_nnadapter_device_names(self, device_names):
|
||||
"""Set nnadapter device name for Paddle Lite backend.
|
||||
"""
|
||||
return self._option.set_lite_nnadapter_device_names(device_names)
|
||||
|
||||
def set_lite_nnadapter_context_properties(self, context_properties):
|
||||
"""Set nnadapter context properties for Paddle Lite backend.
|
||||
"""
|
||||
return self._option.set_lite_nnadapter_context_properties(
|
||||
context_properties)
|
||||
|
||||
def set_lite_nnadapter_model_cache_dir(self, model_cache_dir):
|
||||
"""Set nnadapter model cache dir for Paddle Lite backend.
|
||||
"""
|
||||
return self._option.set_lite_nnadapter_model_cache_dir(model_cache_dir)
|
||||
|
||||
def set_lite_nnadapter_dynamic_shape_info(self, dynamic_shape_info):
|
||||
""" Set nnadapter dynamic shape info for Paddle Lite backend.
|
||||
"""
|
||||
return self._option.set_lite_nnadapter_dynamic_shape_info(
|
||||
dynamic_shape_info)
|
||||
|
||||
def set_lite_nnadapter_subgraph_partition_path(self,
|
||||
subgraph_partition_path):
|
||||
""" Set nnadapter subgraph partition path for Paddle Lite backend.
|
||||
"""
|
||||
return self._option.set_lite_nnadapter_subgraph_partition_path(
|
||||
subgraph_partition_path)
|
||||
|
||||
def set_lite_nnadapter_subgraph_partition_config_buffer(
|
||||
self, subgraph_partition_buffer):
|
||||
""" Set nnadapter subgraph partition buffer for Paddle Lite backend.
|
||||
"""
|
||||
return self._option.set_lite_nnadapter_subgraph_partition_config_buffer(
|
||||
subgraph_partition_buffer)
|
||||
|
||||
def set_lite_nnadapter_mixed_precision_quantization_config_path(
|
||||
self, mixed_precision_quantization_config_path):
|
||||
""" Set nnadapter mixed precision quantization config path for Paddle Lite backend..
|
||||
"""
|
||||
return self._option.set_lite_nnadapter_mixed_precision_quantization_config_path(
|
||||
mixed_precision_quantization_config_path)
|
||||
|
||||
def set_paddle_mkldnn(self, use_mkldnn=True):
|
||||
"""Enable/Disable MKLDNN while using Paddle Inference backend, mkldnn is enabled by default.
|
||||
"""
|
||||
|
Reference in New Issue
Block a user