diff options
author | Richard Burton <richard.burton@arm.com> | 2020-04-08 16:39:05 +0100 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-04-10 16:11:09 +0000 |
commit | dc0c6ed9f8b993e63f492f203d7d7080ab4c835c (patch) | |
tree | ea8541990b13ebf1a038009aa6b8b4b1ea8c3f55 /python/pyarmnn/test/test_types.py | |
parent | fe5a24beeef6e9a41366e694f41093565e748048 (diff) | |
download | armnn-dc0c6ed9f8b993e63f492f203d7d7080ab4c835c.tar.gz |
Add PyArmNN to work with ArmNN API of 20.02
* Add Swig rules for generating python wrapper
* Add documentation
* Add tests and testing data
Change-Id: If48eda08931514fa21e72214dfead2835f07237c
Signed-off-by: Richard Burton <richard.burton@arm.com>
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'python/pyarmnn/test/test_types.py')
-rw-r--r-- | python/pyarmnn/test/test_types.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/python/pyarmnn/test/test_types.py b/python/pyarmnn/test/test_types.py new file mode 100644 index 0000000000..dfe1429c02 --- /dev/null +++ b/python/pyarmnn/test/test_types.py @@ -0,0 +1,29 @@ +# Copyright © 2020 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) |