#!/usr/bin/env python
# coding=utf-8
# Copyright (c) Huawei Technologies Co., Ltd. 2024-2025. All rights reserved.
# MindIE is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# pylint: disable=no-name-in-module
import os
import unittest
from utils.utils.norm import PatchGroupNorm3d
@unittest.skipIf(
os.environ.get("MINDIE_TEST_MODE", "ALL") == "CPU", "Skip NPU-dependent tests when MINDIE_TEST_MODE is CPU."
)
class TestAttentionLayer(unittest.TestCase):
def test_patch_group_norm3d(self):
"""
测试init_register_parameter函数的功能
"""
test_norm = PatchGroupNorm3d(num_groups=16, num_channels=256, affine=False)
self.assertIsNone(test_norm.weight)
self.assertIsNone(test_norm.bias)
if __name__ == '__main__':
unittest.main()