From 245d64c60d0ea30f5080ff53225b5169927e24d6 Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Mon, 2 Dec 2019 12:59:43 +0000 Subject: Work in progress of python bindings for Arm NN Not built or tested in any way Signed-off-by: Matthew Bentham Change-Id: Ie7f92b529aa5087130f0c5cc8c17db1581373236 --- python/pyarmnn/test/test_types.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 python/pyarmnn/test/test_types.py (limited to 'python/pyarmnn/test/test_types.py') diff --git a/python/pyarmnn/test/test_types.py b/python/pyarmnn/test/test_types.py new file mode 100644 index 0000000000..29c0b107bb --- /dev/null +++ b/python/pyarmnn/test/test_types.py @@ -0,0 +1,27 @@ +# Copyright © 2019 Arm Ltd. All rights reserved. +# SPDX-License-Identifier: MIT +import pytest +import pyarmnn as ann + +def test_activation_function(): + assert 0 == ann.ActivationFunction_Sigmoid + assert 1 == ann.ActivationFunction_TanH + assert 2 == ann.ActivationFunction_Linear + assert 3 == ann.ActivationFunction_ReLu + assert 4 == ann.ActivationFunction_BoundedReLu + assert 5 == ann.ActivationFunction_SoftReLu + assert 6 == ann.ActivationFunction_LeakyReLu + assert 7 == ann.ActivationFunction_Abs + assert 8 == ann.ActivationFunction_Sqrt + assert 9 == ann.ActivationFunction_Square + +def test_permutation_vector(): + pv = ann.PermutationVector((0, 2, 3, 1)) + assert pv[0] == 0 + assert pv[2] == 3 + + pv2 = ann.PermutationVector((0, 2, 3, 1)) + assert pv == pv2 + + pv4 = ann.PermutationVector((0, 3, 1, 2)) + assert pv.IsInverse(pv4) -- cgit v1.2.1