diff options
author | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-08 14:24:39 +0100 |
---|---|---|
committer | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-09 17:21:48 +0100 |
commit | f5b293d0927506c2a979a091bf0d07ecc78fa181 (patch) | |
tree | 4de585b7cb6ed34da8237063752270189a730a41 /tests/test_nn_tensorflow_optimizations_pruning.py | |
parent | cde0c6ee140bd108849bff40467d8f18ffc332ef (diff) | |
download | mlia-f5b293d0927506c2a979a091bf0d07ecc78fa181.tar.gz |
MLIA-386 Simplify typing in the source code
- Enable deferred annotations evaluation
- Use builtin types for type hints whenever possible
- Use | syntax for union types
- Rename mlia.core._typing into mlia.core.typing
Change-Id: I3f6ffc02fa069c589bdd9e8bddbccd504285427a
Diffstat (limited to 'tests/test_nn_tensorflow_optimizations_pruning.py')
-rw-r--r-- | tests/test_nn_tensorflow_optimizations_pruning.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_nn_tensorflow_optimizations_pruning.py b/tests/test_nn_tensorflow_optimizations_pruning.py index 5d92f5e..d97b3d3 100644 --- a/tests/test_nn_tensorflow_optimizations_pruning.py +++ b/tests/test_nn_tensorflow_optimizations_pruning.py @@ -1,9 +1,9 @@ # SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """Test for module optimizations/pruning.""" +from __future__ import annotations + from pathlib import Path -from typing import List -from typing import Optional import pytest import tensorflow as tf @@ -21,7 +21,7 @@ from tests.utils.common import train_model def _test_sparsity( metrics: TFLiteMetrics, target_sparsity: float, - layers_to_prune: Optional[List[str]], + layers_to_prune: list[str] | None, ) -> None: pruned_sparsity_dict = metrics.sparsity_per_layer() num_sparse_layers = 0 @@ -62,7 +62,7 @@ def _get_tflite_metrics( def test_prune_simple_model_fully( target_sparsity: float, mock_data: bool, - layers_to_prune: Optional[List[str]], + layers_to_prune: list[str] | None, tmp_path: Path, test_keras_model: Path, ) -> None: |