34 lines
928 B
Python
Executable File
34 lines
928 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
快速运行全量化类型测试
|
|
使用 ONNX yolov5s 模型测试所有支持的量化类型
|
|
"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# 添加测试目录到路径
|
|
sys.path.insert(0, str(Path(__file__).parent / "unit"))
|
|
|
|
if __name__ == '__main__':
|
|
import unittest
|
|
from test_all_quantization_types import TestAllQuantizationTypes
|
|
|
|
print("="*80)
|
|
print("🚀 Netrans 全量化类型测试")
|
|
print("="*80)
|
|
print("测试模型: ONNX yolov5s")
|
|
print("测试范围: 所有支持的量化类型 (30+种)")
|
|
print("="*80)
|
|
print()
|
|
|
|
# 创建测试套件
|
|
loader = unittest.TestLoader()
|
|
suite = loader.loadTestsFromTestCase(TestAllQuantizationTypes)
|
|
|
|
# 运行测试
|
|
runner = unittest.TextTestRunner(verbosity=2)
|
|
result = runner.run(suite)
|
|
|
|
# 退出码
|
|
sys.exit(0 if result.wasSuccessful() else 1)
|