mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 09:07:10 +08:00
Polish cmake files and runtime apis (#36)
* Add custom operator for onnxruntime ans fix paddle backend * Polish cmake files and runtime apis * Remove copy libraries * fix some issue * fix bug * fix bug
This commit is contained in:
@@ -55,27 +55,33 @@ class FastDeployModel:
|
||||
return self._model.initialized()
|
||||
|
||||
|
||||
class FastDeployRuntime:
|
||||
class Runtime:
|
||||
def __init__(self, runtime_option):
|
||||
self._runtime = C.Runtime();
|
||||
assert self._runtime.init(runtime_option), "Initialize FastDeployRuntime Failed!"
|
||||
self._runtime = C.Runtime()
|
||||
assert self._runtime.init(runtime_option), "Initialize Runtime Failed!"
|
||||
|
||||
def infer(self, data):
|
||||
assert isinstance(data, dict), "The input data should be type of dict."
|
||||
return self._runtime.infer(data)
|
||||
|
||||
def num_inputs(self):
|
||||
return self._runtime.num_inputs();
|
||||
return self._runtime.num_inputs()
|
||||
|
||||
def num_outputs(self):
|
||||
return self._runtime.num_outputs();
|
||||
return self._runtime.num_outputs()
|
||||
|
||||
def get_input_info(self, index):
|
||||
assert isinstance(index, int), "The input parameter index should be type of int."
|
||||
assert index < self.num_inputs(), "The input parameter index:{} should less than number of inputs:{}.".format(index, self.num_inputs)
|
||||
assert isinstance(
|
||||
index, int), "The input parameter index should be type of int."
|
||||
assert index < self.num_inputs(
|
||||
), "The input parameter index:{} should less than number of inputs:{}.".format(
|
||||
index, self.num_inputs)
|
||||
return self._runtime.get_input_info(index)
|
||||
|
||||
def get_output_info(self, index):
|
||||
assert isinstance(index, int), "The input parameter index should be type of int."
|
||||
assert index < self.num_outputs(), "The input parameter index:{} should less than number of outputs:{}.".format(index, self.num_outputs)
|
||||
assert isinstance(
|
||||
index, int), "The input parameter index should be type of int."
|
||||
assert index < self.num_outputs(
|
||||
), "The input parameter index:{} should less than number of outputs:{}.".format(
|
||||
index, self.num_outputs)
|
||||
return self._runtime.get_output_info(index)
|
||||
|
Reference in New Issue
Block a user