blob: 1ba07423a1e7c064ef77d430796ebbbced8e2046 [file] [log] [blame]
Diego Russod0eee262020-04-23 18:14:37 +01001# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
2#
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an AS IS BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# Description:
17# Contains unit tests for tflite_reader
18import pytest
Louis Verhaard0b8268a2020-08-05 16:11:29 +020019
Diego Russod0eee262020-04-23 18:14:37 +010020from ethosu.vela.tflite_reader import TFLiteSubgraph
21
22
23class TestTFLiteSubgraph:
24
25 # Generate some data for testing len1_array_to_scalar
26 len1_testdata = [
27 (0, None),
28 pytest.param(1, None, marks=pytest.mark.xfail),
29 ([1, 2, 3], [1, 2, 3]),
30 ([10], 10),
31 ([], []),
32 ]
33
34 @pytest.mark.parametrize("test_input,expected", len1_testdata)
35 def test_len1_array_to_scalar(self, test_input, expected):
36 output = TFLiteSubgraph.len1_array_to_scalar(test_input)
37 assert output == expected