Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/tensorflow/lite/python/metrics/metrics.py: 60%
30 statements
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 07:57 +0000
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 07:57 +0000
1# Copyright 2021 The TensorFlow 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# ==============================================================================
15"""Python TFLite metrics helper."""
16import os
17from typing import Optional, Text
19# pylint: disable=g-import-not-at-top
20if not os.path.splitext(__file__)[0].endswith(
21 os.path.join('tflite_runtime', 'metrics_portable')):
22 # This file is part of tensorflow package.
23 from tensorflow.lite.python.metrics import metrics_interface # type: ignore
24else:
25 # This file is part of tflite_runtime package.
26 from tflite_runtime import metrics_interface # type: ignore
27# pylint: enable=g-import-not-at-top
30class TFLiteMetrics(metrics_interface.TFLiteMetricsInterface):
31 """TFLite metrics helper."""
33 def __init__(self,
34 model_hash: Optional[Text] = None,
35 model_path: Optional[Text] = None) -> None:
36 pass
38 def increase_counter_debugger_creation(self):
39 pass
41 def increase_counter_interpreter_creation(self):
42 pass
44 def increase_counter_converter_attempt(self):
45 pass
47 def increase_counter_converter_success(self):
48 pass
50 def set_converter_param(self, name, value):
51 pass
53 def set_converter_error(self, error_data):
54 pass
56 def set_converter_latency(self, value):
57 pass
60class TFLiteConverterMetrics(TFLiteMetrics):
61 """Similar to TFLiteMetrics but specialized for converter."""
63 def __del__(self):
64 pass
66 def set_export_required(self):
67 pass
69 def export_metrics(self):
70 pass