From 86ad1e35c49936ed643b887e9cc8a7d8dc96f8f7 Mon Sep 17 00:00:00 2001 From: George Ohashi Date: Wed, 17 Apr 2024 13:24:28 +0000 Subject: [PATCH] lifecycle conftest --- .../quantization/lifecycle/conftest.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/sparsetensors/quantization/lifecycle/conftest.py diff --git a/tests/sparsetensors/quantization/lifecycle/conftest.py b/tests/sparsetensors/quantization/lifecycle/conftest.py new file mode 100644 index 00000000..a8ad01b2 --- /dev/null +++ b/tests/sparsetensors/quantization/lifecycle/conftest.py @@ -0,0 +1,37 @@ +# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import List, Optional + +import pytest +from sparsetensors.quantization.quant_args import QuantizationArgs +from sparsetensors.quantization.quant_scheme import QuantizationScheme + + +@pytest.fixture +def create_quantization_scheme(): + def quantization_scheme( + targets: List[str], + weights: Optional[QuantizationArgs] = None, + input_activations: Optional[QuantizationArgs] = None, + output_activations: Optional[QuantizationArgs] = None, + ): + return QuantizationScheme( + targets=targets, + weights=weights, + input_activations=input_activations, + output_activations=output_activations, + ) + + return quantization_scheme