2 Copyright (C) 2018-2019 Intel Corporation
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
17 from openvino.inference_engine import IENetwork, ExecutableNetwork, InferRequest
20 # TODO: network and request are not used
21 # TODO: refactor: create network before inference only
22 class SingleLayerNetwork:
24 One layer network description
30 exec_network: ExecutableNetwork,
31 input_layer_name: str,
33 output_layer_name: str,
34 reference_output_layer_name: str):
36 self._network = network
37 self._exec_network = exec_network
38 self._input_layer_name = input_layer_name
39 self._layer_name = layer_name
40 self._output_layer_name = output_layer_name
41 self._reference_output_layer_name = reference_output_layer_name
42 self._int8_accuracy_list = list()
47 def __exit__(self, type, value, tb):
55 if self._exec_network:
56 del self._exec_network
57 self._exec_network = None
60 def network(self) -> IENetwork:
64 def exec_network(self) -> ExecutableNetwork:
65 return self._exec_network
68 def input_layer_name(self) -> str:
69 return self._input_layer_name
72 def layer_name(self) -> str:
73 return self._layer_name
76 def output_layer_name(self) -> str:
77 return self._output_layer_name
80 def reference_output_layer_name(self) -> str:
81 return self._reference_output_layer_name
84 def int8_accuracy_list(self) -> list:
85 return self._int8_accuracy_list