From 31b9f50b6d7eda4e8fd8f71a5c795e0d0c82de79 Mon Sep 17 00:00:00 2001 From: dboyliao Date: Wed, 6 May 2020 16:43:01 +0800 Subject: [PATCH] update tests --- .../test_tflm/test_export}/__init__.py | 0 .../test_tflm/test_export}/conftest.py | 17 +++++++---------- .../test_tflm/test_export}/test_write.py | 0 3 files changed, 7 insertions(+), 10 deletions(-) rename tests/{tflm/tflite_export => test_transformer/test_tflm/test_export}/__init__.py (100%) rename tests/{tflm/tflite_export => test_transformer/test_tflm/test_export}/conftest.py (87%) rename tests/{tflm/tflite_export => test_transformer/test_tflm/test_export}/test_write.py (100%) diff --git a/tests/tflm/tflite_export/__init__.py b/tests/test_transformer/test_tflm/test_export/__init__.py similarity index 100% rename from tests/tflm/tflite_export/__init__.py rename to tests/test_transformer/test_tflm/test_export/__init__.py diff --git a/tests/tflm/tflite_export/conftest.py b/tests/test_transformer/test_tflm/test_export/conftest.py similarity index 87% rename from tests/tflm/tflite_export/conftest.py rename to tests/test_transformer/test_tflm/test_export/conftest.py index dd5bc005..54b11e71 100644 --- a/tests/tflm/tflite_export/conftest.py +++ b/tests/test_transformer/test_tflm/test_export/conftest.py @@ -1,17 +1,14 @@ import numpy as np from pytest import fixture -import tensorflow as tf -from utensor_cgen.ir import TensorInfo, OperationInfo, uTensorGraph -from utensor_cgen.ir.converter import (AttrValueConverter, DataTypeConverter, - GenericTensorConverterMixin) -from utensor_cgen.utils import prune_graph, topologic_order_graph -from utensor_cgen.backend.operators import OperatorFactory, _Operator -from utensor_cgen.matcher import OpEqualityDelegate, _morphism +from utensor_cgen.backend.utensor.code_generator.legacy._operators import ( + OperatorFactory, _Operator, uTensorOpEqualityDelegate) +from utensor_cgen.ir import OperationInfo, TensorInfo, uTensorGraph +from utensor_cgen.ir.converter import AttrValueConverter, DataTypeConverter @OperatorFactory.register -@OpEqualityDelegate.is_associative( +@uTensorOpEqualityDelegate.is_associative( permutations=((0, 1), (1, 0)) ) class _TFLM_AddOperator(_Operator): @@ -51,7 +48,7 @@ def build_op_info(cls, ugraph, name, tensor_x, tensor_y, **kwargs): ) }, ugraph=ugraph, - backend=kwargs.get('backend', 'TFLM') + lib_name=kwargs.get('lib_name', 'tflite') ) @@ -93,7 +90,7 @@ def build_op_info(cls, ugraph, name, tensor_x, tensor_w, tensor_b, **kwargs): ) }, ugraph=ugraph, - backend=kwargs.get('backend', 'TFLM') + lib_name=kwargs.get('lib_name', 'tflite') ) @fixture(name='hybrid_quant_output') diff --git a/tests/tflm/tflite_export/test_write.py b/tests/test_transformer/test_tflm/test_export/test_write.py similarity index 100% rename from tests/tflm/tflite_export/test_write.py rename to tests/test_transformer/test_tflm/test_export/test_write.py