4 from __future__
import absolute_import
5 from __future__
import division
6 from __future__
import print_function
7 from __future__
import unicode_literals
9 from onnx.backend.base
import BackendRep, namedtupledict
14 def __init__(self, cpp_rep):
15 super(Caffe2CppRep, self).__init__()
22 return self.__core.init_net()
25 return self.__core.pred_net()
27 def external_outputs(self):
28 return self.__core.external_outputs()
30 def external_inputs(self):
31 return self.__core.external_inputs()
33 def run(self, inputs):
35 if isinstance(inputs, dict):
36 output_values = self.__core.run(inputs)
37 elif isinstance(inputs, list)
or isinstance(inputs, tuple):
39 raise RuntimeError(
'Expected {} values for uninitialized ' 40 'graph inputs ({}), but got {}.'.format(
47 output_values = self.__core.run(input_map)
50 output_values = self.__core.run([inputs])