"""
Copyright (C) 2024 The ONNXIFIER Authors.

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.
"""

# pylint: disable=missing-function-docstring

from openvino import Model
from openvino.opset1 import parameter, reduce_max, reduce_mean, reduce_min
from openvino.opset4 import reduce_l1, reduce_l2

from . import convert_xml


def test_reduce_max_opset1():
    p = parameter([1, 64, 32, 32])
    r = reduce_max(p, 1)
    model = Model([r], [p])
    convert_xml(model)


def test_reduce_mean_opset1():
    p = parameter([1, 64, 32, 32])
    r = reduce_mean(p, [1, 2, 3])
    model = Model([r], [p])
    convert_xml(model)


def test_reduce_min_opset1():
    p = parameter([1, 64, 32, 32])
    r = reduce_min(p, [-1, -2])
    model = Model([r], [p])
    convert_xml(model)


def test_reduce_l1_opset4():
    p = parameter([1, 64, 32, 32])
    r = reduce_l1(p, 1)
    model = Model([r], [p])
    convert_xml(model)


def test_reduce_l2_opset4():
    p = parameter([1, 64, 32, 32])
    r = reduce_l2(p, 1)
    model = Model([r], [p])
    convert_xml(model)
