diff --git a/.ai-rulez/config.yaml b/.ai-rulez/config.yaml new file mode 100644 index 000000000..a53d720d3 --- /dev/null +++ b/.ai-rulez/config.yaml @@ -0,0 +1,22 @@ +$schema: https://raw.githubusercontent.com/Goldziher/ai-rulez/main/schema/ai-rules-v3.schema.json +description: Convert PaddlePaddle models to ONNX format +gitignore: true +name: Paddle2ONNX + +builtins: + - python + - security + - git-workflow + - code-quality + - testing + - token-efficiency + - default-commands + +presets: + - claude + - gemini + - codex + +compression: + level: moderate +version: "3.0" diff --git a/.gitignore b/.gitignore index 8286d89d4..19d8b5f93 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,12 @@ paddle2onnx/*.so paddle2onnx/__pycache_* protobuf-* +# Python / uv +.venv +__pycache__/ +*.egg-info/ +.hypothesis/ + # Temporary files automatically generated when executing Paddle2ONNX unit tests *.pdmodel *.pdiparams diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 1192f8f48..000000000 --- a/.gitmodules +++ /dev/null @@ -1,15 +0,0 @@ -[submodule "third_party/onnx"] - path = third_party/onnx - url = https://github.com/onnx/onnx.git - branch = 990217f043af7222348ca8f0301e17fa7b841781 -[submodule "third_party/optimizer"] - path = third_party/optimizer - url = https://github.com/onnx/optimizer.git - branch = b3a4611861734e0731bbcc2bed1f080139e4988b -[submodule "third_party/pybind11"] - path = third_party/pybind11 - url = https://github.com/pybind/pybind11.git - branch = 3e9dfa2866941655c56877882565e7577de6fc7b -[submodule "third_party/glog"] - path = third_party/glog - url = https://github.com/google/glog.git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82d313a7d..bf9e594e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,111 +1,54 @@ -# Exclude all third-party libraries -exclude: | - (?x)^( - patches/.+| - third_party/.+ - )$ +default_install_hook_types: + - pre-commit + - commit-msg +exclude: ^third_party/|vendor/|node_modules/|dist/|\.setuptools-cmake-build/|patches/ + repos: -# Common hooks -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-added-large-files - - id: check-merge-conflict - - id: check-symlinks - - id: detect-private-key - - id: end-of-file-fixer - - id: trailing-whitespace -- repo: https://github.com/Lucas-C/pre-commit-hooks.git - rev: v1.5.1 - hooks: - - id: remove-crlf - - id: remove-tabs - name: Tabs remover (C++) - files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$ - args: [--whitespaces-count, '2'] - - id: remove-tabs - name: Tabs remover (Python) - files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$ - args: [--whitespaces-count, '4'] - # Exclude some unit test files that require tabs. -- repo: local - hooks: - - id: copyright_checker - name: copyright_checker - entry: python ./tools/codestyle/copyright.py - language: system - files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps|py|pyi|sh)$ -# For Python files -- repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.8.0 - hooks: - - id: black -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 - hooks: - - id: ruff - args: [--fix, --exit-non-zero-on-fix, --no-cache] -# For C++ files -- repo: local - hooks: - - id: clang-format - name: clang-format - description: Format files with ClangFormat. - entry: bash ./tools/codestyle/clang_format.sh -i - language: system - files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$ -- repo: local - hooks: - - id: cpplint-cpp-source - name: cpplint - description: Check C++ code style using cpplint.py. - entry: bash ./tools/codestyle/cpplint_pre_commit.sh - language: system - files: \.(cc|cxx|cpp|cu|h|hpp|hxx)$ - args: - - --extensions=cc,cxx,cpp,cu,cuh,h,hpp,hxx,kps - - --filter=-readability/fn_size,-build/include_what_you_use,-build/c++11,-whitespace/parens - - --quiet -- repo: local - hooks: - - id: clang-tidy - name: clang-tidy - description: Parallel clang-tidy runner. - entry: python ./tools/codestyle/clang-tidy.py - language: system - files: \.(c|cc|cxx|cpp|h|hpp|hxx)$ - args: - - -p=build/ - - -extra-arg=-Wno-unknown-warning-option - - -extra-arg=-Wno-pessimizing-move - - -extra-arg=-Wno-braced-scalar-init - - -extra-arg=-Wno-dangling-gsl - - -extra-arg=-Wno-deprecated-copy - - -extra-arg=-Wno-final-dtor-non-final-class - - -extra-arg=-Wno-implicit-int-float-conversion - - -extra-arg=-Wno-inconsistent-missing-override - - -extra-arg=-Wno-infinite-recursion - - -extra-arg=-Wno-mismatched-tags - - -extra-arg=-Wno-self-assign - - -extra-arg=-Wno-sign-compare - - -extra-arg=-Wno-sometimes-uninitialized - - -extra-arg=-Wno-tautological-overlap-compare - - -extra-arg=-Wno-unused-const-variable - - -extra-arg=-Wno-unused-lambda-capture - - -extra-arg=-Wno-unused-private-field - - -extra-arg=-Wno-unused-value - - -extra-arg=-Wno-unused-variable - - -extra-arg=-Wno-overloaded-virtual - - -extra-arg=-Wno-defaulted-function-deleted - - -extra-arg=-Wno-delete-non-abstract-non-virtual-dtor - - -extra-arg=-Wno-return-type-c-linkage -# For CMake files -- repo: https://github.com/cheshirekow/cmake-format-precommit - rev: v0.6.13 - hooks: - - id: cmake-format -- repo: https://github.com/PFCCLab/cmake-lint-paddle - rev: v1.5.1 - hooks: - - id: cmakelint - args: [--config=./tools/codestyle/.cmakelintrc] + # Commit message linting + - repo: https://github.com/Goldziher/gitfluff + rev: v0.8.0 + hooks: + - id: gitfluff-lint + args: ["--write"] + stages: [commit-msg] + + # AI-Rulez: auto-generate AI assistant configuration files + - repo: https://github.com/Goldziher/ai-rulez + rev: v3.8.3 + hooks: + - id: ai-rulez-generate + + # General file checks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-merge-conflict + - id: check-added-large-files + - id: detect-private-key + - id: check-json + - id: check-yaml + args: ["--allow-multiple-documents", "--unsafe"] + - id: check-toml + - id: check-case-conflict + + # TOML formatting + - repo: https://github.com/tox-dev/pyproject-fmt + rev: "v2.16.2" + hooks: + - id: pyproject-fmt + + - repo: https://github.com/ComPWA/taplo-pre-commit + rev: v0.9.3 + hooks: + - id: taplo-format + exclude: "pyproject.toml" + + # Python: ruff (linting + formatting) + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.15.5 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..24ee5b1be --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/CMakeLists.txt b/CMakeLists.txt index 816d78da3..46d90cb65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,15 @@ cmake_minimum_required(VERSION 3.16) project(paddle2onnx C CXX) -# ONNX 1.16 requires C++ 17 set(CMAKE_CXX_STANDARD 17) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -# Build the libraries with - fPIC set(CMAKE_POSITION_INDEPENDENT_CODE ON) -# Always link with libstdc++ fs.a when using GCC 8. link_libraries( "$<$,$,9.0>>:-lstdc++fs>" ) -option(WITH_STATIC "Compile Paddle2ONNX with STATIC" OFF) +option(WITH_STATIC "Compile Paddle2ONNX with STATIC" OFF) option(PADDLE2ONNX_DEBUG "If open the debug log while converting model" OFF) -option(MSVC_STATIC_CRT "Compile Paddle2ONNX with MSVC STATIC CRT" OFF) +option(MSVC_STATIC_CRT "Compile Paddle2ONNX with MSVC STATIC CRT" OFF) if(MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") add_definitions(-DPADDLE_WITH_TESTING) @@ -22,12 +19,9 @@ if(PADDLE2ONNX_DEBUG) add_definitions(-DPADDLE2ONNX_DEBUG) endif() -# Set max opset version for onnx if you build from other version of onnx this -# should be modified. -add_definitions(-DMAX_ONNX_OPSET_VERSION=23) +add_definitions(-DMAX_ONNX_OPSET_VERSION=25) add_definitions(-DPADDLE2ONNX_LIB) -# Internal flags for convert.h.in set(WITH_PADDLE2ONNX_STATIC_INTERNAL OFF) if(WITH_STATIC) set(WITH_PADDLE2ONNX_STATIC_INTERNAL @@ -40,117 +34,138 @@ include(utils) configure_file(${PROJECT_SOURCE_DIR}/paddle2onnx/mappers_registry.h.in ${PROJECT_SOURCE_DIR}/paddle2onnx/mappers_registry.h) -# Third dependency : onnx -if(NOT TARGET onnx_proto) - if(NOT ONNX_NAMESPACE) - set(ONNX_NAMESPACE "onnx") - endif() - add_definitions("-DONNX_NAMESPACE=${ONNX_NAMESPACE}") - add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/onnx) +# --- Dependencies --- + +# Protobuf (try CONFIG mode first, fall back to module mode) +find_package(Protobuf CONFIG) +if(NOT Protobuf_FOUND) + find_package(Protobuf REQUIRED) +endif() + +include(FetchContent) + +# ONNX (built from source for protobuf compatibility) +if(NOT ONNX_NAMESPACE) + set(ONNX_NAMESPACE "onnx") +endif() +add_definitions("-DONNX_NAMESPACE=${ONNX_NAMESPACE}") + +set(ONNX_USE_LITE_PROTO OFF CACHE BOOL "" FORCE) +set(ONNX_ML ON CACHE BOOL "" FORCE) +set(ONNX_USE_PROTOBUF_SHARED_LIBS OFF CACHE BOOL "" FORCE) +set(ONNX_BUILD_TESTS OFF CACHE BOOL "" FORCE) +set(ONNX_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE) + +FetchContent_Declare( + onnx + GIT_REPOSITORY https://github.com/onnx/onnx.git + GIT_TAG v1.20.1 + GIT_SHALLOW TRUE +) +FetchContent_MakeAvailable(onnx) + +# onnx-optimizer: fetch source only, compile directly +FetchContent_Declare( + onnx_optimizer + GIT_REPOSITORY https://github.com/onnx/optimizer.git + GIT_TAG b3a4611861734e0731bbcc2bed1f080139e4988b # v0.3.19 + GIT_SHALLOW FALSE + PATCH_COMMAND ${CMAKE_COMMAND} -P + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_optimizer.cmake +) +FetchContent_Populate(onnx_optimizer) + +# pybind11 (system-installed) +find_package(pybind11 REQUIRED) + +# glog (system-installed) +if(MSVC) + set(WITH_GFLAGS + OFF + CACHE BOOL "Disable gflags support in glog") endif() +find_package(glog REQUIRED) # generate Paddle2ONNX proto files add_subdirectory(${PROJECT_SOURCE_DIR}/paddle2onnx/proto) include_directories(${PROJECT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${PROJECT_SOURCE_DIR}/third_party/optimizer) +include_directories(${onnx_optimizer_SOURCE_DIR}) -file(GLOB_RECURSE ALL_SRCS ${PROJECT_SOURCE_DIR}/paddle2onnx/*.cc - ${PROJECT_SOURCE_DIR}/third_party/optimizer/onnxoptimizer/*.cc) +# Collect sources: paddle2onnx + onnx-optimizer (compiled in) +file(GLOB_RECURSE OPTIMIZER_SRCS + ${onnx_optimizer_SOURCE_DIR}/onnxoptimizer/*.cc) +file(GLOB_RECURSE ALL_SRCS ${PROJECT_SOURCE_DIR}/paddle2onnx/*.cc) +list(APPEND ALL_SRCS ${OPTIMIZER_SRCS}) list(REMOVE_ITEM ALL_SRCS ${PROJECT_SOURCE_DIR}/paddle2onnx/cpp2py_export.cc) list(REMOVE_ITEM ALL_SRCS - ${PROJECT_SOURCE_DIR}/third_party/optimizer/onnxoptimizer/cpp2py_export.cc) + ${onnx_optimizer_SOURCE_DIR}/onnxoptimizer/cpp2py_export.cc) file(READ "${PROJECT_SOURCE_DIR}/VERSION_NUMBER" PADDLE2ONNX_VERSION) string(STRIP "${PADDLE2ONNX_VERSION}" PADDLE2ONNX_VERSION) +# find Python site-packages and PaddlePaddle +set(PYTHON_SITE_PACKAGES "") +execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c + "import site; print(';'.join(site.getsitepackages()))" + OUTPUT_VARIABLE SITE_PACKAGES_LIST + OUTPUT_STRIP_TRAILING_WHITESPACE) +string(REPLACE ";" " " SITE_PACKAGES_LIST "${SITE_PACKAGES_LIST}") +separate_arguments(SITE_PACKAGES_LIST) +foreach(SITE_PACKAGES IN LISTS SITE_PACKAGES_LIST) + if(EXISTS "${SITE_PACKAGES}" AND SITE_PACKAGES MATCHES "site-packages") + string(REPLACE "\\" "/" PYTHON_SITE_PACKAGES "${SITE_PACKAGES}") + message(STATUS "Found valid site-packages path: ${PYTHON_SITE_PACKAGES}.") + break() + endif() +endforeach() +if(NOT PYTHON_SITE_PACKAGES) + message(FATAL_ERROR "No valid site-packages path found.") +endif() + +if(MSVC) + set(PADDLE_LIB "${PYTHON_SITE_PACKAGES}/paddle/base/libpaddle.lib") + set(COMMON_LIB "${PYTHON_SITE_PACKAGES}/paddle/libs/common.lib") +else() + set(PADDLE_LIB "${PYTHON_SITE_PACKAGES}/paddle/base/libpaddle.so") +endif() +if(EXISTS ${PADDLE_LIB}) + message(STATUS "Found libpaddle: ${PADDLE_LIB}.") +else() + message( + FATAL_ERROR + "Can not find libpaddle at ${PYTHON_SITE_PACKAGES}/paddle/base!") +endif() +set(PADDLE_INCLUDE_DIR ${PYTHON_SITE_PACKAGES}/paddle/include/) +include_directories(${PADDLE_INCLUDE_DIR}) + +if(MSVC) + add_custom_target( + pir_patch ALL + COMMAND + ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/patch/paddle/interface_support.h + ${PADDLE_INCLUDE_DIR}/paddle/pir/include/core/interface_support.h + COMMENT "PIR patch for MSVC") +endif() + if(WITH_STATIC) - # Here, we use a dummy target (paddle2onnx_dummy) to form a build dependency - # tree for paddle2onnx_static lib. add_library(paddle2onnx_dummy STATIC ${ALL_SRCS}) - - if(APPLE) - set_target_properties(paddle2onnx_dummy PROPERTIES COMPILE_FLAGS - "-fvisibility=hidden") - elseif(MSVC) - message("------ BUILD WITH MSVC --------") - else() + if(NOT MSVC) set_target_properties(paddle2onnx_dummy PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") endif() target_link_libraries(paddle2onnx_dummy p2o_paddle_proto onnx) - # Bundle paddle2onnx static lib here bundle_static_library(paddle2onnx_dummy paddle2onnx_static bundle_paddle2onnx) else() add_library(paddle2onnx SHARED ${ALL_SRCS}) - - # add pybind11 - add_subdirectory(third_party/pybind11) - - # add glog - if(MSVC) - set(WITH_GFLAGS - OFF - CACHE BOOL "Disable gflags support in glog") - endif() - add_subdirectory(third_party/glog) - - # find Python site-packages dir - set(PYTHON_SITE_PACKAGES "") - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c - "import site; print(';'.join(site.getsitepackages()))" - OUTPUT_VARIABLE SITE_PACKAGES_LIST - OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REPLACE ";" " " SITE_PACKAGES_LIST "${SITE_PACKAGES_LIST}") - separate_arguments(SITE_PACKAGES_LIST) - foreach(SITE_PACKAGES IN LISTS SITE_PACKAGES_LIST) - if(EXISTS "${SITE_PACKAGES}" AND SITE_PACKAGES MATCHES "site-packages") - string(REPLACE "\\" "/" PYTHON_SITE_PACKAGES "${SITE_PACKAGES}") - message(STATUS "Found valid site-packages path: ${PYTHON_SITE_PACKAGES}.") - break() - endif() - endforeach() - if(NOT PYTHON_SITE_PACKAGES) - message(FATAL_ERROR "No valid site-packages path found.") - endif() - - if(MSVC) - set(PADDLE_LIB "${PYTHON_SITE_PACKAGES}/paddle/base/libpaddle.lib") - set(COMMON_LIB "${PYTHON_SITE_PACKAGES}/paddle/libs/common.lib") - else() - set(PADDLE_LIB "${PYTHON_SITE_PACKAGES}/paddle/base/libpaddle.so") - endif() - if(EXISTS ${PADDLE_LIB}) - message(STATUS "Found libpaddle: ${PADDLE_LIB}.") - else() - message( - FATAL_ERROR - "Can not find libpaddle at ${PYTHON_SITE_PACKAGES}/paddle/base!") - endif() - # add paddle include dir - set(PADDLE_INCLUDE_DIR ${PYTHON_SITE_PACKAGES}/paddle/include/) - include_directories(${PADDLE_INCLUDE_DIR}) - if(MSVC) - # PIR patch - add_custom_target( - pir_patch ALL - COMMAND - ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_SOURCE_DIR}/patch/paddle/interface_support.h - ${PADDLE_INCLUDE_DIR}/paddle/pir/include/core/interface_support.h - COMMENT - "Replace file ${PADDLE_INCLUDE_DIR}/paddle/pir/include/core/interface_support.h with ${CMAKE_SOURCE_DIR}/patch/paddle/interface_support.h" - ) - endif() if(APPLE) set_target_properties(paddle2onnx PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") elseif(MSVC) message("------ BUILD WITH MSVC --------") - # remove `interface` macro defined in MSVC - # target_compile_options(paddle2onnx PRIVATE /Uinterface) else() set_target_properties(paddle2onnx PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") @@ -213,20 +228,11 @@ if(BUILD_PADDLE2ONNX_PYTHON) PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) target_include_directories( paddle2onnx_cpp2py_export - PRIVATE $ - $ + PRIVATE $ $ ${PYTHON_INCLUDE_DIR} - ${PADDLE_INCLUDE_DIR}) - - if(EXISTS - ${PROJECT_SOURCE_DIR}/third_party/pybind11/include/pybind11/pybind11.h) - target_include_directories( - paddle2onnx_cpp2py_export - PUBLIC ${PROJECT_SOURCE_DIR}/third_party/pybind11/include) - else() - message(FATAL_ERROR "cannot find pybind") - endif() + ${PADDLE_INCLUDE_DIR} + ${pybind11_INCLUDE_DIRS}) if(APPLE) set_target_properties(paddle2onnx_cpp2py_export @@ -234,11 +240,9 @@ if(BUILD_PADDLE2ONNX_PYTHON) target_link_libraries(paddle2onnx_cpp2py_export PRIVATE -Wl,-force_load,$) elseif(MSVC) - # In MSVC, we will add whole archive in default target_link_libraries(paddle2onnx_cpp2py_export PRIVATE -WHOLEARCHIVE:$) else() - # Assume everything else is like gcc target_link_libraries( paddle2onnx_cpp2py_export PRIVATE "-Wl,--whole-archive" $ @@ -255,20 +259,6 @@ if(BUILD_PADDLE2ONNX_PYTHON) target_link_libraries(paddle2onnx_cpp2py_export PRIVATE ${PYTHON_LIBRARIES}) target_compile_options( paddle2onnx_cpp2py_export - PRIVATE /MP - /wd4244 # 'argument': conversion from 'google::protobuf::uint64' - # to 'int', possible loss of data - /wd4267 # Conversion from 'size_t' to 'int', possible loss of data - /wd4996 # The second parameter is ignored. - ${EXTRA_FLAGS}) - if(ONNX_USE_PROTOBUF_SHARED_LIBS) - target_compile_options( - onnx_cpp2py_export - PRIVATE /wd4251 # 'identifier' : class 'type1' needs to have - # dll-interface to be used by clients of class 'type2' - ) - endif() - add_msvc_runtime_flag(paddle2onnx_cpp2py_export) - add_onnx_global_defines(paddle2onnx_cpp2py_export) + PRIVATE /MP /wd4244 /wd4267 /wd4996 ${EXTRA_FLAGS}) endif() endif() diff --git a/README.md b/README.md index 2bcb079bd..1021923fe 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,12 @@ Paddle2ONNX 支持将 **PaddlePaddle** 模型格式转化到 **ONNX** 模型格 ## 2 Paddle2ONNX 环境依赖 -Paddle2ONNX 依赖PaddlePaddle3.0,我们建议您在以下环境下使用 Paddle2ONNX : +Paddle2ONNX 依赖 PaddlePaddle 3.3+,我们建议您在以下环境下使用 Paddle2ONNX : -- PaddlePaddle == 3.0.0 +- Python >= 3.10 +- PaddlePaddle >= 3.3 +- ONNX >= 1.20.1 +- protobuf >= 34.0 - onnxruntime >= 1.10.0 ## 3 安装 Paddle2ONNX diff --git a/README_en.md b/README_en.md index 19c81e376..93770a92f 100644 --- a/README_en.md +++ b/README_en.md @@ -8,9 +8,12 @@ Paddle2ONNX supports the conversion of PaddlePaddle model format to ONNX model f ## 2 Paddle2ONNX Environment Dependencies -Paddle2ONNX depends on paddle3.0, we recommend using Paddle2ONNX in the following environments: +Paddle2ONNX depends on PaddlePaddle 3.3+, we recommend using Paddle2ONNX in the following environments: -- PaddlePaddle == 3.0.0b2 +- Python >= 3.10 +- PaddlePaddle >= 3.3 +- ONNX >= 1.20.1 +- protobuf >= 34.0 - onnxruntime >= 1.10.0 ## 3 Install Paddle2ONNX diff --git a/cmake/patch_optimizer.cmake b/cmake/patch_optimizer.cmake new file mode 100644 index 000000000..cad1d8f09 --- /dev/null +++ b/cmake/patch_optimizer.cmake @@ -0,0 +1,9 @@ +# Patch onnx-optimizer for compatibility with ONNX 1.20.1 +# Dimension constructor is now explicit, so fix implicit conversions + +file(READ "onnxoptimizer/passes/fuse_add_bias_into_conv.h" content) +string(REPLACE + "std::vector s = {1};" + "std::vector s = {Dimension(1)};" + content "${content}") +file(WRITE "onnxoptimizer/passes/fuse_add_bias_into_conv.h" "${content}") diff --git a/debug/p2o_infer_debugger.py b/debug/p2o_infer_debugger.py index 292ec7fda..76e6c27b7 100644 --- a/debug/p2o_infer_debugger.py +++ b/debug/p2o_infer_debugger.py @@ -13,20 +13,22 @@ # limitations under the License. import argparse +import logging import os +import queue import re -import sys -import logging import shutil +import sys +import tempfile +import traceback +from contextlib import contextmanager + import numpy as np from onnxruntime import InferenceSession +from prune_onnx_model import prune_onnx_model + import paddle import paddle2onnx -from prune_onnx_model import prune_onnx_model -from contextlib import contextmanager -import traceback -import queue -import tempfile current_dir = os.path.dirname(os.path.abspath(__file__)) tests_dir = os.path.join(current_dir, "..", "tests") @@ -202,8 +204,8 @@ def check_operator_with_print( def _redirect_paddle_output_to_file( paddle_model_file, log_file, inputs_data: tuple ): - import subprocess import pickle + import subprocess import tempfile temp_filename = None @@ -266,7 +268,7 @@ def _compare_results(paddle_model_path, onnx_model_path, inputs_data: tuple): # TODO(wangmingkai02): adjust n according to the number of print op n = 8 shape_list, dtype, data_list = [], None, [] - with open(log_file, "r", encoding="utf-8") as f: + with open(log_file, encoding="utf-8") as f: lines = [] for _ in range(n): line = f.readline() @@ -291,7 +293,7 @@ def _compare_results(paddle_model_path, onnx_model_path, inputs_data: tuple): providers=["CPUExecutionProvider"], ) input_names = session.get_inputs() - input_feed = dict() + input_feed = {} for idx, input_name in enumerate(input_names): input_feed[input_name.name] = inputs_data[idx] result = session.run(output_names=None, input_feed=input_feed) @@ -359,10 +361,7 @@ def _binary_search(program, block): idx = (left + right) // 2 + offset op = block.ops[idx] op_name = op.name() - if idx < left: - left = idx - offset + 1 - offset = 0 - elif op_name in SKIP_FORWARD_OP_LIST: + if idx < left or op_name in SKIP_FORWARD_OP_LIST: left = idx - offset + 1 offset = 0 elif op_name in SKIP_BACKWARD_OP_LIST: @@ -533,7 +532,7 @@ def _compare_results( providers=["CPUExecutionProvider"], ) input_names = session.get_inputs() - input_feed = dict() + input_feed = {} for idx, input_name in enumerate(input_names): input_feed[input_name.name] = inputs_data[idx] result = session.run(output_names=None, input_feed=input_feed) @@ -606,10 +605,7 @@ def _check_operator(program, model_file, idx, input_shapes, input_dtypes): clone_program = program.clone() idx = (left + right) // 2 + offset op = clone_program.blocks[0].ops[idx] - if idx < left: - left = idx - offset + 1 - offset = 0 - elif op.name() in SKIP_FORWARD_OP_LIST: + if idx < left or op.name() in SKIP_FORWARD_OP_LIST: left = idx - offset + 1 offset = 0 elif op.name() in SKIP_BACKWARD_OP_LIST: @@ -654,7 +650,7 @@ def locate_issue( model_file, input_shapes, input_dtypes, - candidates: list[int] = None, + candidates: list[int] | None = None, has_cf=False, binary_search=False, output_num=1, @@ -705,7 +701,7 @@ def _get_mapping_and_uniq_set(program): index_mapping = {} ops = set() global_ops = set() - global_res = list() + global_res = [] shadow_output_op_num = 0 for block in program.blocks: ops |= _dfs(block, index_mapping) diff --git a/debug/prune_onnx_model.py b/debug/prune_onnx_model.py index ecbcfdd78..e4baca24e 100644 --- a/debug/prune_onnx_model.py +++ b/debug/prune_onnx_model.py @@ -12,11 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import onnx -from onnx import helper, TensorProto -import os -import math import logging +import math +import os + +import onnx +from onnx import TensorProto, helper logger = logging.getLogger("p2o-logger") @@ -24,9 +25,11 @@ def prune_onnx_model( onnx_model_file, target_node_name="p2o.print", - target_dims=[1], + target_dims=None, target_dtype="float32", ): + if target_dims is None: + target_dims = [1] dtype_map = { "bool": (TensorProto.BOOL, bool), "float32": (TensorProto.FLOAT, float), diff --git a/docs/en/compile_local.md b/docs/en/compile_local.md index 10351d907..75fee14c2 100644 --- a/docs/en/compile_local.md +++ b/docs/en/compile_local.md @@ -3,35 +3,25 @@ The compilation and installation of Paddle2ONNX require ensuring that the environment meets the following requirements: - cmake >= 3.16.0 -- protobuf == 21.12 +- Python >= 3.10 +- protobuf >= 34.0 ## 1 Install on Linux/Mac -### 1.1 Install Protobuf +### 1.1 Install System Dependencies -```bash -git clone https://github.com/protocolbuffers/protobuf.git -cd protobuf -git checkout v21.12 -git submodule update --init -mkdir build_source && cd build_source -cmake ../cmake -DCMAKE_INSTALL_PREFIX=`pwd`/installed_protobuf_lib -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -make -j -make install +Install protobuf, glog, and pybind11 via your system package manager. -# set the library to environment -export PATH=${PWD}/installed_protobuf_lib/bin:${PATH} -``` -### Alternatively: +On Mac (via Homebrew): -Install Protobuf via apt (Linux): ```bash -sudo apt install protobuf-compiler +brew install protobuf glog pybind11 ``` -Install Protobuf via homebrew (Mac): +On Linux (via apt): + ```bash -brew install protobuf +sudo apt install protobuf-compiler libprotobuf-dev libgoogle-glog-dev pybind11-dev ``` ### 1.2 Install PaddlePaddle @@ -45,9 +35,8 @@ python -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/pack ```bash git clone https://github.com/PaddlePaddle/Paddle2ONNX.git cd Paddle2ONNX -git submodule update --init -export PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/" -python -m build +uv sync +uv run python setup.py build pip install dist/*.whl ``` @@ -73,8 +62,7 @@ Note that the `-DCMAKE_INSTALL_PREFIX` in the following cmake command specifies ```bash git clone https://github.com/protocolbuffers/protobuf.git cd protobuf -git checkout v21.12 -git submodule update --init --recursive +git checkout v34.0 mkdir build cd build cmake -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=%CD%\protobuf_install -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF .. @@ -88,9 +76,7 @@ set PATH=%CD%\protobuf_install\bin;%PATH% ```bash git clone https://github.com/PaddlePaddle/Paddle2ONNX.git cd Paddle2ONNX -git submodule update --init -set PIP_EXTRA_INDEX_URL=https://www.paddlepaddle.org.cn/packages/nightly/cpu/ -pip install setuptools wheel auditwheel auditwheel-symbols build -python -m build +uv sync +uv run python setup.py build pip install dist/*.whl ``` diff --git a/docs/en/model_zoo.md b/docs/en/model_zoo.md index 2ee11abe4..b7b59b0ce 100644 --- a/docs/en/model_zoo.md +++ b/docs/en/model_zoo.md @@ -5,18 +5,18 @@ Due to the differences between frameworks, some models may not be supported. If ## Image classification -Comprehensive coverage of image classification models,now we support the whole series model in PaddlClas [release/2.1](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1). +Comprehensive coverage of image classification models,now we support the whole series model in PaddlClas [develop](https://github.com/PaddlePaddle/PaddleClas/tree/develop). |Models | Source | |---|---| -| ResNet series| [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#ResNet_and_Vd_series)| -| Mobile series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#Mobile_series)| -| SEResNeXt and Res2Net series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#SEResNeXt_and_Res2Net_series)| -| DPN and DenseNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#DPN_and_DenseNet_series)| -| HRNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#HRNet_series)| -| Inception series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#Inception_series)| -| EfficientNet and ResNeXt101_wsl series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#EfficientNet_and_ResNeXt101_wsl_series)| -| ResNeSt and RegNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#ResNeSt_and_RegNet_series)| +| ResNet series| [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#ResNet_and_Vd_series)| +| Mobile series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#Mobile_series)| +| SEResNeXt and Res2Net series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#SEResNeXt_and_Res2Net_series)| +| DPN and DenseNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#DPN_and_DenseNet_series)| +| HRNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#HRNet_series)| +| Inception series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#Inception_series)| +| EfficientNet and ResNeXt101_wsl series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#EfficientNet_and_ResNeXt101_wsl_series)| +| ResNeSt and RegNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#ResNeSt_and_RegNet_series)| ## OCR @@ -32,17 +32,17 @@ Support UNet, HRNet, DeepLab and so on. Test models are from PaddleSeg [release/ | Models | Source | |-------|--------| -|BiSeNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.1/configs/bisenet) | -|DANet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/danet) | -|DeepLabv3|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/deeplabv3) | -|Deeplabv3P |[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/deeplabv3p) | -|FCN|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/fcn) | -|GCNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/gcnet) | -|OCRNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/ocrnet) | -|UNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/unet) | +|BiSeNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/configs/bisenet) | +|DANet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/danet) | +|DeepLabv3|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/deeplabv3) | +|Deeplabv3P |[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/deeplabv3p) | +|FCN|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/fcn) | +|GCNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/gcnet) | +|OCRNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/ocrnet) | +|UNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/unet) | ## object detection -Support 8 object detection archtectures. Test models are from PaddleDetection [release/2.1](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.1) +Support 8 object detection archtectures. Test models are from PaddleDetection [develop](https://github.com/PaddlePaddle/PaddleDetection/tree/develop) | Models | Source | | ----------- | ------------------------------------------------------------ | | YOLO-V3 | https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/yolov3/ | diff --git a/docs/tech_walkthrough/paddle2onnx_tech_walkthrough.ipynb b/docs/tech_walkthrough/paddle2onnx_tech_walkthrough.ipynb index 67acc1ec4..3e2a92ec4 100644 --- a/docs/tech_walkthrough/paddle2onnx_tech_walkthrough.ipynb +++ b/docs/tech_walkthrough/paddle2onnx_tech_walkthrough.ipynb @@ -33,6 +33,7 @@ "import paddle\n", "import paddle.nn.functional as F\n", "\n", + "\n", "class MyModel(paddle.nn.Layer):\n", " def __init__(self, input_size, hidden_size):\n", " super().__init__()\n", @@ -45,10 +46,11 @@ " x = self.linear2(x)\n", " return x\n", "\n", + "\n", "input_size, hidden_size = 8, 4\n", "model = MyModel(input_size, hidden_size)\n", "\n", - "x_input_spec = paddle.static.InputSpec([None, input_size], 'float32', 'x')\n", + "x_input_spec = paddle.static.InputSpec([None, input_size], \"float32\", \"x\")\n", "paddle.jit.save(model, \"./demo\", input_spec=[x_input_spec])" ] }, @@ -83,10 +85,8 @@ "import paddle2onnx\n", "\n", "paddle2onnx.export(\n", - " model_file='./demo.pdmodel',\n", - " params_file='./demo.pdiparams',\n", - " save_file='./demo.onnx'\n", - " )" + " model_file=\"./demo.pdmodel\", params_file=\"./demo.pdiparams\", save_file=\"./demo.onnx\"\n", + ")" ] }, { @@ -155,10 +155,10 @@ "import paddle.base.proto.framework_pb2 as pppb\n", "\n", "prog = pppb.ProgramDesc()\n", - "with open('./demo.pdmodel', \"rb\") as f:\n", + "with open(\"./demo.pdmodel\", \"rb\") as f:\n", " prog.ParseFromString(f.read())\n", - " \n", - "print(str(prog)[:100] + '\\n...\\n' + str(prog)[-100:])\n", + "\n", + "print(str(prog)[:100] + \"\\n...\\n\" + str(prog)[-100:])\n", "# print(prog)" ] }, @@ -214,8 +214,8 @@ "source": [ "import onnx\n", "\n", - "m = onnx.load('./demo.onnx')\n", - "print(str(m)[:100] + '\\n...\\n' + str(m)[-100:])\n", + "m = onnx.load(\"./demo.onnx\")\n", + "print(str(m)[:100] + \"\\n...\\n\" + str(m)[-100:])\n", "# print(m)" ] }, @@ -262,28 +262,31 @@ } ], "source": [ - "import struct \n", + "import struct\n", + "\n", "import numpy as np\n", "\n", - "with open('./demo.pdiparams', 'rb') as f:\n", + "with open(\"./demo.pdiparams\", \"rb\") as f:\n", " raw_content = f.read()\n", "\n", "idx = 0\n", - "while(idx < len(raw_content)):\n", - " magic_number1, lod_level, magic_number_2, tensor_desc_size = struct.unpack('=IQIi', raw_content[idx:idx+20])\n", + "while idx < len(raw_content):\n", + " magic_number1, lod_level, magic_number_2, tensor_desc_size = struct.unpack(\n", + " \"=IQIi\", raw_content[idx : idx + 20]\n", + " )\n", " print(f\"lod_level: {lod_level} tensor_desc_size {tensor_desc_size}\")\n", " idx = idx + 20\n", "\n", " tensor_desc = pppb.VarType.TensorDesc()\n", - " tensor_desc.ParseFromString(raw_content[idx:idx+tensor_desc_size])\n", - " idx = idx+tensor_desc_size\n", - " \n", + " tensor_desc.ParseFromString(raw_content[idx : idx + tensor_desc_size])\n", + " idx = idx + tensor_desc_size\n", + "\n", " numel = 1\n", " for ele in tensor_desc.dims:\n", " numel = numel * ele\n", - " \n", + "\n", " # 4 in next line because sizeof(float32)=4\n", - " weight = np.frombuffer(raw_content[idx:idx+numel*4], dtype=np.float32)\n", + " weight = np.frombuffer(raw_content[idx : idx + numel * 4], dtype=np.float32)\n", " print(f\"shape: {tensor_desc.dims}\")\n", " print(f\"weight: {weight}\")\n", " idx = idx + numel * 4" @@ -390,10 +393,10 @@ } ], "source": [ - "print('>>> all variables:')\n", - "print('\\n'.join([f\"{x.name}, {x.persistable}\" for x in prog.blocks[0].vars]))\n", - "print('>>> all ops:')\n", - "print('\\n'.join([op.type for op in prog.blocks[0].ops]))" + "print(\">>> all variables:\")\n", + "print(\"\\n\".join([f\"{x.name}, {x.persistable}\" for x in prog.blocks[0].vars]))\n", + "print(\">>> all ops:\")\n", + "print(\"\\n\".join([op.type for op in prog.blocks[0].ops]))" ] }, { @@ -456,43 +459,47 @@ ], "source": [ "from onnx import TensorProto\n", - "from onnx.helper import (\n", - " make_model, make_node, make_graph,\n", - " make_tensor_value_info)\n", "from onnx.checker import check_model\n", + "from onnx.helper import make_graph, make_model, make_node, make_tensor_value_info\n", "\n", - "x = make_tensor_value_info('x', TensorProto.FLOAT, [None, input_size])\n", - "y = make_tensor_value_info('y', TensorProto.FLOAT, [None])\n", + "x = make_tensor_value_info(\"x\", TensorProto.FLOAT, [None, input_size])\n", + "y = make_tensor_value_info(\"y\", TensorProto.FLOAT, [None])\n", "\n", - "weights = {'A':model.linear1.weight,\n", - " 'A_bias':model.linear1.bias,\n", - " 'B':model.linear2.weight,\n", - " 'B_bias':model.linear2.bias}\n", + "weights = {\n", + " \"A\": model.linear1.weight,\n", + " \"A_bias\": model.linear1.bias,\n", + " \"B\": model.linear2.weight,\n", + " \"B_bias\": model.linear2.bias,\n", + "}\n", "\n", "weight_nodes = []\n", "\n", - "for name,weight in weights.items():\n", - " n = make_node(\n", - " \"Constant\", [], [name],\n", - " value=onnx.helper.make_tensor(\n", - " name=name,\n", - " data_type=onnx.TensorProto.FLOAT,\n", - " dims=weight.shape,\n", - " vals=weight.numpy().flatten(),\n", - " )\n", - " )\n", + "for name, weight in weights.items():\n", + " n = make_node(\n", + " \"Constant\",\n", + " [],\n", + " [name],\n", + " value=onnx.helper.make_tensor(\n", + " name=name,\n", + " data_type=onnx.TensorProto.FLOAT,\n", + " dims=weight.shape,\n", + " vals=weight.numpy().flatten(),\n", + " ),\n", + " )\n", " weight_nodes.append(n)\n", "\n", - "node1 = make_node('MatMul', ['x', 'A'], ['XA'])\n", - "node2 = make_node('Add', ['XA', 'A_bias'], ['linear1_out'])\n", - "node3 = make_node('Sigmoid', ['linear1_out'], ['sigmoid'])\n", - "node4 = make_node('MatMul', ['sigmoid', 'B'], ['sigmoidB'])\n", - "node5 = make_node('Add', ['sigmoidB', 'B_bias'], ['y'])\n", + "node1 = make_node(\"MatMul\", [\"x\", \"A\"], [\"XA\"])\n", + "node2 = make_node(\"Add\", [\"XA\", \"A_bias\"], [\"linear1_out\"])\n", + "node3 = make_node(\"Sigmoid\", [\"linear1_out\"], [\"sigmoid\"])\n", + "node4 = make_node(\"MatMul\", [\"sigmoid\", \"B\"], [\"sigmoidB\"])\n", + "node5 = make_node(\"Add\", [\"sigmoidB\", \"B_bias\"], [\"y\"])\n", "\n", - "graph = make_graph(weight_nodes + [node1, node2, node3, node4, node5], # nodes\n", - " 'demograph', # a name\n", - " [x], # inputs\n", - " [y]) # outputs\n", + "graph = make_graph(\n", + " [*weight_nodes, node1, node2, node3, node4, node5], # nodes\n", + " \"demograph\", # a name\n", + " [x], # inputs\n", + " [y],\n", + ") # outputs\n", "\n", "onnx_model = make_model(graph)\n", "check_model(onnx_model)\n", @@ -537,7 +544,7 @@ } ], "source": [ - "print('>>> onnx graph converted using paddle2onnx :')\n", + "print(\">>> onnx graph converted using paddle2onnx :\")\n", "print(onnx.helper.printable_graph(m.graph))" ] }, diff --git a/docs/zh/compile_docker.md b/docs/zh/compile_docker.md index 3eeda0b1e..195bb7fb2 100644 --- a/docs/zh/compile_docker.md +++ b/docs/zh/compile_docker.md @@ -24,13 +24,11 @@ docker exec -it p2o_build /bin/bash ## 3 拉取 Paddle2ONNX 仓库 -执行以下命令来拉取并初始化 Paddle2ONNX 仓库 +执行以下命令来拉取 Paddle2ONNX 仓库 ```bash git clone https://github.com/PaddlePaddle/Paddle2ONNX.git cd Paddle2ONNX -git submodule init -git submodule update ``` ## 4 获取 protobuf 依赖库 @@ -50,7 +48,7 @@ source .github/workflows/scripts/download_protobuf.sh ```bash git clone https://github.com/protocolbuffers/protobuf.git cd protobuf -git checkout v3.16.0 +git checkout v34.0 mkdir build_source && cd build_source cmake ../cmake -DCMAKE_INSTALL_PREFIX=${PWD}/installed_protobuf_lib -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release make -j8 @@ -63,8 +61,9 @@ export PATH=${PWD}/installed_protobuf_lib/bin:${PATH} ## 5 执行编译和安装 ```bash -/opt/python/cp38-cp38/bin/pip install setuptools wheel auditwheel auditwheel-symbols build +/opt/python/cp310-cp310/bin/pip install uv cd /path/to/Paddle2ONNX -/opt/python/cp38-cp38/bin/python -m build -/opt/python/cp38-cp38/bin/pip install dist/*.whl +/opt/python/cp310-cp310/bin/python -m uv sync +/opt/python/cp310-cp310/bin/python -m uv run python setup.py build +/opt/python/cp310-cp310/bin/pip install dist/*.whl ``` diff --git a/docs/zh/compile_local.md b/docs/zh/compile_local.md index 702ee0c55..0a7e14179 100644 --- a/docs/zh/compile_local.md +++ b/docs/zh/compile_local.md @@ -3,38 +3,25 @@ Paddle2ONNX 的编译安装需要确保环境满足以下需求: - cmake >= 3.16.0 -- protobuf == 21.12 +- Python >= 3.10 +- protobuf >= 34.0 ## 1 在 Linux/Mac 下安装 -### 1.1 安装 Protobuf +### 1.1 安装系统依赖 -```bash -git clone https://github.com/protocolbuffers/protobuf.git -cd protobuf -git checkout v21.12 -git submodule update --init -mkdir build_source && cd build_source -cmake ../cmake -DCMAKE_INSTALL_PREFIX=`pwd`/installed_protobuf_lib -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -make -j -make install - -# 将库路径添加到环境变量 -export PATH=${PWD}/installed_protobuf_lib/bin:${PATH} -``` - -### 或者: +通过系统包管理器安装 protobuf、glog 和 pybind11。 -通过 apt 安装 Protobuf (Linux): +通过 homebrew 安装 (Mac): ```bash -sudo apt install protobuf-compiler +brew install protobuf glog pybind11 ``` -通过 homebrew 安装 Protobuf (Mac): +通过 apt 安装 (Linux): ```bash -brew install protobuf +sudo apt install protobuf-compiler libprotobuf-dev libgoogle-glog-dev pybind11-dev ``` ### 1.2 安装 PaddlePaddle @@ -48,9 +35,8 @@ python -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/pack ```bash git clone https://github.com/PaddlePaddle/Paddle2ONNX.git cd Paddle2ONNX -git submodule update --init -export PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/" -python -m build +uv sync +uv run python setup.py build pip install dist/*.whl ``` @@ -78,8 +64,7 @@ pip install dist/*.whl ```bash git clone https://github.com/protocolbuffers/protobuf.git cd protobuf -git checkout v21.12 -git submodule update --init --recursive +git checkout v34.0 mkdir build cd build cmake -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=%CD%\protobuf_install -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF .. @@ -93,9 +78,7 @@ set PATH=%CD%\protobuf_install\bin;%PATH% ```bash git clone https://github.com/PaddlePaddle/Paddle2ONNX.git cd Paddle2ONNX -git submodule update --init -set PIP_EXTRA_INDEX_URL=https://www.paddlepaddle.org.cn/packages/nightly/cpu/ -pip install setuptools wheel auditwheel auditwheel-symbols build -python -m build +uv sync +uv run python setup.py build pip install dist/*.whl ``` diff --git a/docs/zh/model_zoo.md b/docs/zh/model_zoo.md index 016006434..ee7ab16ce 100644 --- a/docs/zh/model_zoo.md +++ b/docs/zh/model_zoo.md @@ -5,22 +5,22 @@ Paddle2ONNX支持将飞桨模型转换为ONNX格式存储。 ## 图像分类 -目前已支持PaddlClas中大部分模型 [release/2.1](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1). +目前已支持PaddlClas中大部分模型 [develop](https://github.com/PaddlePaddle/PaddleClas/tree/develop). |Models | Source | |---|---| -| ResNet series| [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#ResNet_and_Vd_series)| -| Mobile series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#Mobile_series)| -| SEResNeXt and Res2Net series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#SEResNeXt_and_Res2Net_series)| -| DPN and DenseNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#DPN_and_DenseNet_series)| -| HRNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#HRNet_series)| -| Inception series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#Inception_series)| -| EfficientNet and ResNeXt101_wsl series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#EfficientNet_and_ResNeXt101_wsl_series)| -| ResNeSt and RegNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1#ResNeSt_and_RegNet_series)| +| ResNet series| [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#ResNet_and_Vd_series)| +| Mobile series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#Mobile_series)| +| SEResNeXt and Res2Net series | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#SEResNeXt_and_Res2Net_series)| +| DPN and DenseNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#DPN_and_DenseNet_series)| +| HRNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#HRNet_series)| +| Inception series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#Inception_series)| +| EfficientNet and ResNeXt101_wsl series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#EfficientNet_and_ResNeXt101_wsl_series)| +| ResNeSt and RegNet series |[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop#ResNeSt_and_RegNet_series)| ## OCR -支持PaddleOCR的轻量级和服务端文字识别模型 PaddleOCR [release/2.1](https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.1)。 +支持PaddleOCR的轻量级和服务端文字识别模型 PaddleOCR [develop](https://github.com/PaddlePaddle/PaddleOCR/tree/develop)。 | Models | Source | |-------|--------| @@ -28,21 +28,21 @@ Paddle2ONNX支持将飞桨模型转换为ONNX格式存储。 |Chinese and English general OCR model (143.4M)|[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR#pp-ocr-20-series-model-listupdate-on-dec-15) | ## 语义分割 -支持语义分割模型库PaddleSeg中的大部分模型 [release/v2.1](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.1)。 +支持语义分割模型库PaddleSeg中的大部分模型 [release/v2.1](https://github.com/PaddlePaddle/PaddleSeg/tree/develop)。 | Models | Source | |-------|--------| -|BiSeNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.1/configs/bisenet) | -|DANet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/danet) | -|DeepLabv3|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/deeplabv3) | -|Deeplabv3P |[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/deeplabv3p) | -|FCN|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/fcn) | -|GCNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/gcnet) | -|OCRNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/ocrnet) | -|UNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/unet) | +|BiSeNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/configs/bisenet) | +|DANet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/danet) | +|DeepLabv3|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/deeplabv3) | +|Deeplabv3P |[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/deeplabv3p) | +|FCN|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/fcn) | +|GCNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/gcnet) | +|OCRNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/ocrnet) | +|UNet|[PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/configs/unet) | ## 目标检测 -支持目标检测模型库中8种检测结构 [release/2.1](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.1) +支持目标检测模型库中8种检测结构 [develop](https://github.com/PaddlePaddle/PaddleDetection/tree/develop) | Models | Source | | ----------- | ------------------------------------------------------------ | | YOLO-V3 | https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/yolov3/ | diff --git a/paddle2onnx/__init__.py b/paddle2onnx/__init__.py index 594d9cedb..090664062 100755 --- a/paddle2onnx/__init__.py +++ b/paddle2onnx/__init__.py @@ -11,11 +11,11 @@ # 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. -import sys import importlib.metadata -import packaging.version as pv import warnings +import packaging.version as pv + try: err_msg = ( "Please install the latest paddle: python -m pip install --pre " @@ -30,30 +30,26 @@ paddle_version = importlib.metadata.version(lib_paddle_name) if paddle_version == "0.0.0": warnings.warn( - f"You are currently using the development version of {lib_paddle_name}. " - f"Please ensure that its commit ID is more recent than the 'fedc65a'." + f"You are currently using the development version of {lib_paddle_name}. ", + stacklevel=2, ) else: - min_version = "3.0.0.dev20250426" - if ( - sys.platform == "win32" - and ( - pv.parse(paddle_version) < pv.parse(min_version) - or paddle_version == "3.0.0" - ) - ) or pv.parse(paddle_version) < pv.parse(min_version): + min_version = "3.0.0" + if pv.parse(paddle_version) < pv.parse(min_version): raise ValueError( f"The paddlepaddle version should not be less than {min_version}. {err_msg}" ) -except ImportError: +except ImportError as exc: raise ImportError( f"Failed to import paddle. Please ensure paddle is installed. {err_msg}" - ) + ) from exc +from .convert import ( + dygraph2onnx, # noqa: F401 + export, # noqa: F401 + load_parameter, # noqa: F401 + save_program, # noqa: F401 +) from .version import version -from .convert import export # noqa: F401 -from .convert import dygraph2onnx # noqa: F401 -from .convert import load_parameter # noqa: F401 -from .convert import save_program # noqa: F401 __version__ = version diff --git a/paddle2onnx/command.py b/paddle2onnx/command.py index f1c57b005..2f5dc2cf4 100755 --- a/paddle2onnx/command.py +++ b/paddle2onnx/command.py @@ -14,8 +14,9 @@ import argparse import ast -import sys import os +import sys + import paddle2onnx from paddle2onnx.utils import logging @@ -144,18 +145,16 @@ def main(): if args.version: logging.info( - "paddle2onnx-{} with python>=3.8, paddlepaddle>=3.0.0".format( - paddle2onnx.__version__ - ) + f"paddle2onnx-{paddle2onnx.__version__} with python>=3.8, paddlepaddle>=3.0.0" ) return - assert ( - args.model_dir is not None - ), "--model_dir should be defined while translating paddle model to onnx" - assert ( - args.save_file is not None - ), "--save_file should be defined while translating paddle model to onnx" + assert args.model_dir is not None, ( + "--model_dir should be defined while translating paddle model to onnx" + ) + assert args.save_file is not None, ( + "--save_file should be defined while translating paddle model to onnx" + ) model_file = os.path.join(args.model_dir, args.model_filename) if args.params_filename is None: diff --git a/paddle2onnx/convert.py b/paddle2onnx/convert.py index e77becf8d..80e93c21a 100755 --- a/paddle2onnx/convert.py +++ b/paddle2onnx/convert.py @@ -13,15 +13,16 @@ # limitations under the License. import os -import paddle +import shutil import tempfile -import paddle2onnx.paddle2onnx_cpp2py_export as c_p2o -from paddle2onnx.utils import logging, paddle2onnx_export_configs +import traceback from contextlib import contextmanager -from paddle.decomposition import decomp + +import paddle +import paddle2onnx.paddle2onnx_cpp2py_export as c_p2o from paddle.base.executor import global_scope -import shutil -import traceback +from paddle.decomposition import decomp +from paddle2onnx.utils import logging, paddle2onnx_export_configs PADDLE2ONNX_EXPORT_TEMP_DIR = None @@ -89,7 +90,7 @@ def load_parameter(program): def decompose_program(model_filename): """Decomposes the given pir program.""" - model_file_path, new_model_file_path, new_model_file_name, new_params_file_name = ( + model_file_path, new_model_file_path, new_model_file_name, _new_params_file_name = ( get_tmp_dir_and_file(model_filename, "_decompose") ) model = paddle.jit.load(model_file_path) @@ -139,9 +140,9 @@ def export( ): global PADDLE2ONNX_EXPORT_TEMP_DIR # check model_filename - assert os.path.exists( - model_filename - ), f"Model file {model_filename} does not exist." + assert os.path.exists(model_filename), ( + f"Model file {model_filename} does not exist." + ) if not os.path.exists(params_filename): logging.warning( f"Params file {params_filename} does not exist, " @@ -167,7 +168,7 @@ def export( place = paddle.CPUPlace() exe = paddle.static.Executor(place) with paddle.pir_utils.OldIrGuard(): - [inference_program, feed_target_names, fetch_targets] = ( + [inference_program, _feed_target_names, _fetch_targets] = ( paddle.static.load_inference_model(model_file_path, exe) ) if verbose: @@ -196,14 +197,17 @@ def export( if verbose: logging.info("Complete the conversion from .pdmodel to json file.") - if paddle.get_flags("FLAGS_enable_pir_api")["FLAGS_enable_pir_api"]: - if dist_prim_all and auto_upgrade_opset: - if verbose: - logging.info("Try to decompose program ...") - # TODO(wangmingkai02): Do we need to update params_filename here? - model_filename = decompose_program(model_filename) - if verbose: - logging.info("Complete the decomposition of combined operators.") + if ( + paddle.get_flags("FLAGS_enable_pir_api")["FLAGS_enable_pir_api"] + and dist_prim_all + and auto_upgrade_opset + ): + if verbose: + logging.info("Try to decompose program ...") + # TODO(wangmingkai02): Do we need to update params_filename here? + model_filename = decompose_program(model_filename) + if verbose: + logging.info("Complete the decomposition of combined operators.") if verbose and PADDLE2ONNX_EXPORT_TEMP_DIR is not None: logging.info( @@ -291,6 +295,7 @@ def export( "Try to perform optimization on the ONNX model with onnxoptimizer." ) import io + import onnx import onnxoptimizer @@ -320,6 +325,7 @@ def export( ) os.environ["POLYGRAPHY_AUTOINSTALL_DEPS"] = "1" import io + import onnx from polygraphy.backend.onnx import fold_constants @@ -358,9 +364,10 @@ def export( else: with open(save_file, "wb") as f: f.write(onnx_model_str) - logging.info("ONNX model saved in {}.".format(save_file)) + logging.info(f"ONNX model saved in {save_file}.") else: return onnx_model_str + return None def dygraph2onnx(layer, save_file, input_spec=None, opset_version=9, **configs): @@ -376,7 +383,7 @@ def dygraph2onnx(layer, save_file, input_spec=None, opset_version=9, **configs): ) if not os.path.isfile(model_file): raise ValueError("Failed to save static PaddlePaddle model.") - logging.info("Static PaddlePaddle model saved in {}.".format(paddle_model_dir)) + logging.info(f"Static PaddlePaddle model saved in {paddle_model_dir}.") params_file = os.path.join(paddle_model_dir, "model.pdiparams") if not os.path.isfile(params_file): params_file = "" diff --git a/paddle2onnx/convert_to_fp16.py b/paddle2onnx/convert_to_fp16.py index e95f89019..5fce8c0f4 100755 --- a/paddle2onnx/convert_to_fp16.py +++ b/paddle2onnx/convert_to_fp16.py @@ -11,9 +11,9 @@ # 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 __future__ import absolute_import import argparse + from paddle2onnx.utils import logging @@ -35,4 +35,4 @@ def parse_arguments(): import paddle2onnx.paddle2onnx_cpp2py_export as c_p2o c_p2o.convert_to_fp16(args.input_model_path, args.output_model_path) - logging.info("FP16 model saved in {}.".format(args.output_model_path)) + logging.info(f"FP16 model saved in {args.output_model_path}.") diff --git a/paddle2onnx/optimize.py b/paddle2onnx/optimize.py index 1793981ab..d3673872d 100755 --- a/paddle2onnx/optimize.py +++ b/paddle2onnx/optimize.py @@ -11,9 +11,9 @@ # 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 __future__ import absolute_import import argparse + from paddle2onnx.utils import logging @@ -43,4 +43,4 @@ def parse_arguments(): if args.input_shape_dict != "": shape_dict = eval(args.input_shape_dict) c_p2o.optimize(args.input_model, args.output_model, shape_dict) - logging.info("Model optmized, saved in {}.".format(args.output_model)) + logging.info(f"Model optmized, saved in {args.output_model}.") diff --git a/paddle2onnx/optimizer/convert_fp32_to_fp16.cc b/paddle2onnx/optimizer/convert_fp32_to_fp16.cc index 72ce6488c..0ed55fd3a 100644 --- a/paddle2onnx/optimizer/convert_fp32_to_fp16.cc +++ b/paddle2onnx/optimizer/convert_fp32_to_fp16.cc @@ -832,7 +832,7 @@ void ConvertFp32ToFp16::Convert(ONNX_NAMESPACE::ModelProto* model) { op_block_list_.insert( op_block_list_.end(), custom_ops_.begin(), custom_ops_.end()); } - ONNX_NAMESPACE::shape_inference::InferShapes(*model); + ONNX_NAMESPACE::shape_inference::InferShapes(*model, ONNX_NAMESPACE::OpSchemaRegistry::Instance()); // 1 if it is a FP16 model, skip this if (IsFP16Model(*model)) { P2OLogger(verbose_) << "[Info] The input ONNX Model is a FP16 model." diff --git a/paddle2onnx/optimizer/eliminate_non_transpose.h b/paddle2onnx/optimizer/eliminate_non_transpose.h index 1e43ce307..0894f0934 100644 --- a/paddle2onnx/optimizer/eliminate_non_transpose.h +++ b/paddle2onnx/optimizer/eliminate_non_transpose.h @@ -48,11 +48,7 @@ struct EliminateNonTranspose final : public PredicateBasedPass { } } } - const bool replacing_success = - tryReplacingAllUsesWith(node->output(), node->input()); - if (!replacing_success) { - return false; - } + node->output()->replaceAllUsesWith(node->input()); destroy_current = NodeDestroyType::DestroyOne; return true; } diff --git a/paddle2onnx/optimizer/fuse_constant_cast.h b/paddle2onnx/optimizer/fuse_constant_cast.h index 2ddb620a4..2f29f86e7 100644 --- a/paddle2onnx/optimizer/fuse_constant_cast.h +++ b/paddle2onnx/optimizer/fuse_constant_cast.h @@ -57,9 +57,7 @@ struct FuseConstantCast final : public PredicateBasedPass { auto dtype = cast->i(kto); t.elem_type() = dtype; constant->t_(kvalue, std::move(t)); - if (!tryReplacingAllUsesWith(cast->output(), cast->inputs()[0])) { - return false; - } + cast->output()->replaceAllUsesWith(cast->inputs()[0]); destroy_current = NodeDestroyType::DestroyOne; return true; } diff --git a/paddle2onnx/optimizer/fuse_constant_reshape.h b/paddle2onnx/optimizer/fuse_constant_reshape.h index 4e0262861..ae2ea4573 100644 --- a/paddle2onnx/optimizer/fuse_constant_reshape.h +++ b/paddle2onnx/optimizer/fuse_constant_reshape.h @@ -127,11 +127,7 @@ struct FuseConstantReshape final : public PredicateBasedPass { // update constant node constant->output()->setSizes(reshape->output()->sizes()); constant->output()->setElemType(reshape->output()->elemType()); - const bool replacing_success = - tryReplacingAllUsesWith(reshape->output(), reshape->inputs()[0]); - if (!replacing_success) { - return false; - } + reshape->output()->replaceAllUsesWith(reshape->inputs()[0]); destroy_current = NodeDestroyType::DestroyOne; return true; } diff --git a/paddle2onnx/optimizer/fuse_constant_unsqueeze.h b/paddle2onnx/optimizer/fuse_constant_unsqueeze.h index ca51de8ce..819980a16 100644 --- a/paddle2onnx/optimizer/fuse_constant_unsqueeze.h +++ b/paddle2onnx/optimizer/fuse_constant_unsqueeze.h @@ -96,11 +96,7 @@ struct FuseConstantUnsqueeze final : public PredicateBasedPass { // update constant node constant->output()->setSizes(unsqueeze->output()->sizes()); constant->output()->setElemType(unsqueeze->output()->elemType()); - const bool replacing_success = - tryReplacingAllUsesWith(unsqueeze->output(), unsqueeze->inputs()[0]); - if (!replacing_success) { - return false; - } + unsqueeze->output()->replaceAllUsesWith(unsqueeze->inputs()[0]); destroy_current = NodeDestroyType::DestroyOne; return true; } diff --git a/paddle2onnx/optimizer/fuse_paddle_conv_bias.h b/paddle2onnx/optimizer/fuse_paddle_conv_bias.h index e976241dc..9c3e808fc 100644 --- a/paddle2onnx/optimizer/fuse_paddle_conv_bias.h +++ b/paddle2onnx/optimizer/fuse_paddle_conv_bias.h @@ -84,11 +84,7 @@ struct FusePaddleConvBias final : public PredicateBasedPass { conv->addInput(bias->outputs()[0]); conv->output()->setSizes(add->output()->sizes()); conv->output()->setElemType(add->output()->elemType()); - const bool replacing_success = - tryReplacingAllUsesWith(add->output(), add->inputs()[0]); - if (!replacing_success) { - return false; - } + add->output()->replaceAllUsesWith(add->inputs()[0]); destroy_current = NodeDestroyType::DestroyOne; return true; } diff --git a/paddle2onnx/optimizer/fuse_squeeze_act_unsqueeze.h.bak b/paddle2onnx/optimizer/fuse_squeeze_act_unsqueeze.h.bak deleted file mode 100644 index dc5821b59..000000000 --- a/paddle2onnx/optimizer/fuse_squeeze_act_unsqueeze.h.bak +++ /dev/null @@ -1,102 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -// Before: -// axis = n -// A = Squeeze(x, axis) -// B = Act(A) -// C = Unsqueeze(x, axis) -// After: -// C = act(x) - -#include - -#include "onnx/defs/tensor_util.h" -#include "onnxoptimizer/pass.h" - -namespace ONNX_NAMESPACE { -namespace optimization { - -struct FuseSqueezeActUnsqueeze final : public PredicateBasedPass { - explicit FuseSqueezeActUnsqueeze() - : PredicateBasedPass(PassType::Fuse, PassEfficiency::Complete, - PassOptimizationType::Compute) {} - std::string getPassName() const override { return "fuse_squeeze_act_unsqueeze"; } - - bool patternMatchPredicate(Node* node) override { - // if you want more act supported - // just modify here - return node->kind() == kUnqueeze && - node->inputs()[0]->node()->kind() == kLeakyRelu && - node->inputs()[0]->node()->inputs()[0] == kSqueeze; - } - bool runTransform(Node* n, Graph& graph, - NodeDestroyType& destroy_current) override { - destroy_current = NodeDestroyType::DestroyZero; - - if (n->inputs()[0]->uses().size() > 1) { - return false; - } - if (n->inputs()[0]->node->inputs[0]->uses().size() > 1) { - return false; - } - - Node* unsqueeze = n; - Node* act = n->inputs()[0]->node(); - Node* squeeze = act->inputs()[0]->node(); - - // Process 'axes' data - std::vector unsqueeze_axes; - if (unsqueeze->hasAttribute(kaxes)) { - // opset 13 below - unsqueeze_axes = unsqueeze->is(kaxes); - } else { - // opset 13 and above - first check if 'unsqueeze' has 'axes' input - // constant - if (unsqueeze->inputs()[1]->node()->kind() != kConstant) { - return false; - } - if (unsqueeze->inputs()[1]->uses().size() > 1) { - return false; - } - Node* axes_const = unsqueeze->inputs()[1]->node(); - Tensor t = axes_const->t(kvalue); - unsqueeze_axes = ParseData(&t); - } - - Tensor t = constant->t(kvalue); - const auto& ori_size = t.sizes(); - for (size_t i = 0; i < axes.size(); ++i) { - if (axes[i] < 0) { - axes[i] = axes[i] + ori_size.size() + i + 1; - } - } - - std::vector new_size(ori_size.begin(), ori_size.end()); - for (size_t i = 0; i < axes.size(); ++i) { - new_size.insert(new_size.begin() + axes[i], 1); - } - - t.sizes().clear(); - t.sizes().insert(t.sizes().begin(), new_size.begin(), - new_size.begin() + new_size.size()); - constant->t_(kvalue, std::move(t)); - - // update constant node - constant->output()->setSizes(unsqueeze->output()->sizes()); - constant->output()->setElemType(unsqueeze->output()->elemType()); - const bool replacing_success = - tryReplacingAllUsesWith(unsqueeze->output(), unsqueeze->inputs()[0]); - if (!replacing_success) { - return false; - } - destroy_current = NodeDestroyType::DestroyOne; - return true; - } -}; - -} // namespace optimization -} // namespace ONNX_NAMESPACE diff --git a/paddle2onnx/optimizer/fuse_unsqueeze_conv2d_squeeze.h b/paddle2onnx/optimizer/fuse_unsqueeze_conv2d_squeeze.h index 6db5007b4..7851c8a09 100644 --- a/paddle2onnx/optimizer/fuse_unsqueeze_conv2d_squeeze.h +++ b/paddle2onnx/optimizer/fuse_unsqueeze_conv2d_squeeze.h @@ -153,14 +153,8 @@ struct FuseUnsqueezeConv2dSqueeze final : public PredicateBasedPass { } conv_node->replaceInput(0, unsqueeze_node->inputs()[0]); - if (!tryReplacingAllUsesWith(unsqueeze_node->output(), - unsqueeze_node->inputs()[0])) { - return false; - } - if (!tryReplacingAllUsesWith(squeeze_node->output(), - squeeze_node->inputs()[0])) { - return false; - } + unsqueeze_node->output()->replaceAllUsesWith(unsqueeze_node->inputs()[0]); + squeeze_node->output()->replaceAllUsesWith(squeeze_node->inputs()[0]); // unsqueeze_node->destroy(); // squeeze_node->destroy(); // destroy_current = NodeDestroyType::DestroyZero; diff --git a/paddle2onnx/optimizer/paddle2onnx_optimizer.cc b/paddle2onnx/optimizer/paddle2onnx_optimizer.cc index ca605e098..16da507ae 100644 --- a/paddle2onnx/optimizer/paddle2onnx_optimizer.cc +++ b/paddle2onnx/optimizer/paddle2onnx_optimizer.cc @@ -48,7 +48,7 @@ ONNX_NAMESPACE::ModelProto OptimizeOnnxModel( } try { - shape_inference::InferShapes(optimized_model_proto); + shape_inference::InferShapes(optimized_model_proto, OpSchemaRegistry::Instance()); } catch (const std::exception& e) { paddle2onnx::P2OLogger(true) << "[ERROR] Failed to reinfer shape for this model." << std::endl; @@ -158,7 +158,7 @@ bool OptimizePaddle2ONNX( } try { - shape_inference::InferShapes(*(model_proto.get())); + shape_inference::InferShapes(*(model_proto.get()), OpSchemaRegistry::Instance()); } catch (const std::exception& e) { paddle2onnx::P2OLogger(true) << "[ERROR] Failed to reinfer shape for this model." << std::endl; diff --git a/paddle2onnx/optimizer/replace_add_to_identity.h b/paddle2onnx/optimizer/replace_add_to_identity.h index d7027c6c4..4c473701b 100644 --- a/paddle2onnx/optimizer/replace_add_to_identity.h +++ b/paddle2onnx/optimizer/replace_add_to_identity.h @@ -82,9 +82,7 @@ struct ReplaceAddToIdentity final : public PredicateBasedPass { int32_data.size() == 0 && int64_data.size() == 0) { return false; } - if (!tryReplacingAllUsesWith(add_node->output(), add_node->inputs()[1])) { - return false; - } + add_node->output()->replaceAllUsesWith(add_node->inputs()[1]); } else { auto bias = add_ipt_1->t(kvalue); if (bias.sizes().size() == 1 && bias.sizes()[0] != 1) { @@ -113,9 +111,7 @@ struct ReplaceAddToIdentity final : public PredicateBasedPass { int32_data.size() == 0 && int64_data.size() == 0) { return false; } - if (!tryReplacingAllUsesWith(add_node->output(), add_node->inputs()[0])) { - return false; - } + add_node->output()->replaceAllUsesWith(add_node->inputs()[0]); } return true; } diff --git a/paddle2onnx/optimizer/replace_mul_to_identity.h b/paddle2onnx/optimizer/replace_mul_to_identity.h index 7e33f8f18..4743160bf 100644 --- a/paddle2onnx/optimizer/replace_mul_to_identity.h +++ b/paddle2onnx/optimizer/replace_mul_to_identity.h @@ -82,9 +82,7 @@ struct ReplaceMulToIdentity final : public PredicateBasedPass { int32_data.size() == 0 && int64_data.size() == 0) { return false; } - if (!tryReplacingAllUsesWith(mul_node->output(), mul_node->inputs()[1])) { - return false; - } + mul_node->output()->replaceAllUsesWith(mul_node->inputs()[1]); } else { auto scale = mul_ipt_1->t(kvalue); if (scale.sizes().size() == 1 && scale.sizes()[0] != 1) { @@ -113,9 +111,7 @@ struct ReplaceMulToIdentity final : public PredicateBasedPass { int32_data.size() == 0 && int64_data.size() == 0) { return false; } - if (!tryReplacingAllUsesWith(mul_node->output(), mul_node->inputs()[0])) { - return false; - } + mul_node->output()->replaceAllUsesWith(mul_node->inputs()[0]); } return true; } diff --git a/paddle2onnx/proto/CMakeLists.txt b/paddle2onnx/proto/CMakeLists.txt index 3aa36bbe5..33625d344 100644 --- a/paddle2onnx/proto/CMakeLists.txt +++ b/paddle2onnx/proto/CMakeLists.txt @@ -1,13 +1,6 @@ -if(NOT TARGET protobuf) - include(FindProtobuf) - find_package(Protobuf REQUIRED) - set(Protobuf_USE_STATIC_LIBS ON) - include_directories(${PROTOBUF_INCLUDE_DIR}) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - set(PROTOBUF_LIBRARIES - ${PROTOBUF_LIBRARIES} - CACHE INTERNAL "" FORCE) -endif() +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) -protobuf_generate_cpp(PROTO_SRC PROTO_HEADER p2o_paddle.proto) -add_library(p2o_paddle_proto ${PROTO_HEADER} ${PROTO_SRC}) +add_library(p2o_paddle_proto p2o_paddle.proto) +target_link_libraries(p2o_paddle_proto PUBLIC protobuf::libprotobuf) +protobuf_generate(TARGET p2o_paddle_proto) diff --git a/paddle2onnx/utils.py b/paddle2onnx/utils.py index 6d08e867e..cbb93bc80 100644 --- a/paddle2onnx/utils.py +++ b/paddle2onnx/utils.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import import importlib -import time import sys +import time + import paddle2onnx.paddle2onnx_cpp2py_export as c_p2o @@ -32,23 +32,22 @@ def try_import(module_name): """Try importing a module, with an informative error message on failure.""" install_name = module_name try: - mod = importlib.import_module(module_name) - return mod - except ImportError: + return importlib.import_module(module_name) + except ImportError as exc: err_msg = ( - "Failed importing {}. This likely means that some modules " + f"Failed importing {module_name}. This likely means that some modules " "requires additional dependencies that have to be " - "manually installed (usually with `pip install {}`). " - ).format(module_name, install_name) - raise ImportError(err_msg) + f"manually installed (usually with `pip install {install_name}`). " + ) + raise ImportError(err_msg) from exc def check_model(onnx_model): onnx = try_import("onnx") try: onnx.checker.check_model(onnx_model) - except Exception: - raise Exception("ONNX model is not valid.") + except Exception as exc: + raise Exception("ONNX model is not valid.") from exc finally: logging.info("ONNX model generated is valid.") @@ -73,17 +72,15 @@ def log(level=2, message="", use_color=False): if logging.log_level >= level: if use_color: print( - "{}{} [{}]\t{}\033[0m".format( - level_color[level], current_time, levels[level], message + f"{level_color[level]}{current_time} [{levels[level]}]\t{message}\033[0m".encode().decode( + "latin1" ) - .encode("utf-8") - .decode("latin1") ) else: print( - "{} [{}]\t{}".format(current_time, levels[level], message) - .encode("utf-8") - .decode("latin1") + f"{current_time} [{levels[level]}]\t{message}".encode().decode( + "latin1" + ) ) sys.stdout.flush() @@ -108,59 +105,42 @@ def error(message="", use_color=True, exit=True): def compare_value(a, b, cond): if cond == "equal": - if a != b: - return False - return True + return a == b if cond == "greater_than": - if a <= b: - return False - return True + return not a <= b if cond == "greater_equal": - if a < b: - return False - return True + return not a < b if cond == "less_equal": - if a > b: - return False - return True + return not a > b if cond == "less_than": - if a >= b: - return False - return True + return not a >= b + return None def compare_attr(actual_value, target_value, attr_name, cond="equal"): if not compare_value(actual_value, target_value, cond): raise ValueError( - "Support {} {} {}, actually got {}=={}.".format( - attr_name, cond, target_value, attr_name, actual_value - ) + f"Support {attr_name} {cond} {target_value}, actually got {attr_name}=={actual_value}." ) def compare_attr_between_dims(attr, dims, attr_name, cond="equal"): if not compare_value(attr[dims[0]], attr[dims[1]], cond): - expect_info = "Support {}[{}] {} {}[{}], ".format( - attr_name, dims[0], cond, attr_name, dims[1] - ) - actual_info = "actually got {}[{}]=={}, not {} {}[{}]=={}.".format( - attr_name, dims[0], attr[dims[0]], cond, attr_name, dims[1], attr[dims[1]] - ) + expect_info = f"Support {attr_name}[{dims[0]}] {cond} {attr_name}[{dims[1]}], " + actual_info = f"actually got {attr_name}[{dims[0]}]=={attr[dims[0]]}, not {cond} {attr_name}[{dims[1]}]=={attr[dims[1]]}." raise ValueError(expect_info + actual_info) def require_fixed_shape(op_name=None): logging.error( - "[{}]Fixed shape is required, refer this doc for more information: https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/FAQ.md".format( - op_name - ) + f"[{op_name}]Fixed shape is required, refer this doc for more information: https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/FAQ.md" ) def paddle2onnx_export_configs(configs): - assert isinstance( - configs, dict - ), "create jit.save and paddle2onnx conversion configs from input, but input data is not dict." + assert isinstance(configs, dict), ( + "create jit.save and paddle2onnx conversion configs from input, but input data is not dict." + ) jit_save_configs = { "output_spec", "with_hook", diff --git a/pyproject.toml b/pyproject.toml index a34befaf2..b5dd9ca30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,53 +1,96 @@ [build-system] +build-backend = "setuptools.build_meta" requires = [ - "setuptools>=42", - "wheel", - "cmake>=3.16", - "setuptools-scm", - "paddlepaddle==3.0.0.dev20250426", + "cmake>=3.16", + "paddlepaddle>=3.3,<4", + "setuptools>=42", + "setuptools-scm", + "wheel", ] -build-backend = "setuptools.build_meta" [project] name = "paddle2onnx" -dynamic = ["version"] description = "Export PaddlePaddle to ONNX" readme = "README.md" +license = { text = "Apache License v2.0" } authors = [ - {name = "paddle-infer", email = "paddle-infer@baidu.com"}, + { name = "paddle-infer", email = "paddle-infer@baidu.com" }, ] +requires-python = ">=3.10" classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -license = {text = "Apache License v2.0"} -requires-python = ">=3.8" +dynamic = [ "version" ] dependencies = [ - "onnx>=1.16.1,<=1.17.0", - "onnxoptimizer==0.3.13; python_version < '3.12'", - "polygraphy>=0.49.20", + "onnx>=1.20.1,<2", + "onnxoptimizer>=0.3.13", + "paddlepaddle>=3.3,<4", + "polygraphy>=0.49.20,<1", ] +scripts.paddle2onnx = "paddle2onnx.command:main" -[project.scripts] -paddle2onnx = "paddle2onnx.command:main" - -[tool.setuptools.dynamic] -version = {file = "VERSION_NUMBER"} - -[tool.setuptools.packages.find] -include = ["paddle2onnx*"] +[dependency-groups] +dev = [ + "mypy>=1.15,<2", + "pytest>=8,<9", + "ruff>=0.11,<1", +] +test = [ + "hypothesis>=6,<7", + "onnxruntime>=1.20,<2", + "pytest>=8,<9", +] -[tool.setuptools.exclude-package-data] -"*" = ["*.h", "*.cc", "*.bak", "*.in"] +[tool.setuptools] +dynamic.version = { file = "VERSION_NUMBER" } +exclude-package-data."*" = [ "*.h", "*.cc", "*.bak", "*.in" ] +packages.find.include = [ "paddle2onnx*" ] [tool.setuptools_scm] write_to = "paddle2onnx/version.py" +[tool.ruff] +target-version = "py310" +lint.select = [ + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "E", # pycodestyle errors + "F", # pyflakes + "FURB", # refurb + "I", # isort + "PERF", # perflint + "PIE", # flake8-pie + "RET", # flake8-return + "RUF", # ruff-specific rules + "SIM", # flake8-simplify + "TCH", # flake8-type-checking + "UP", # pyupgrade + "W", # pycodestyle warnings +] +lint.ignore = [ + "E501", # line too long (handled by formatter) + "E721", # type comparison - sometimes intentional + "PERF401", # manual list comprehension - often less readable + "RET504", # unnecessary assignment before return - often clearer with assignment + "SIM108", # ternary operator - often less readable + "SIM112", # capitalized env vars - PaddlePaddle uses lowercase FLAGS_* convention + "SIM115", # open context manager - not always applicable +] + +[tool.pytest] +ini_options.testpaths = [ "tests" ] + [tool.mypy] files = "setup.py" -python_version = "3.8" +python_version = "3.10" strict = true show_error_codes = true -enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] +enable_error_code = [ "ignore-without-code", "redundant-expr", "truthy-bool" ] warn_unreachable = true diff --git a/setup.py b/setup.py index c3b2794e1..33ae686b4 100644 --- a/setup.py +++ b/setup.py @@ -13,20 +13,23 @@ # limitations under the License. # This file referred to github.com/onnx/onnx.git -from distutils import sysconfig, log -import setuptools -import setuptools.command.build_py -import setuptools.command.develop -import setuptools.command.build_ext -from shutil import which +from __future__ import annotations -from contextlib import contextmanager +import multiprocessing import os +import platform import shlex import subprocess import sys -import platform -import multiprocessing +from contextlib import contextmanager +from distutils import log, sysconfig +from shutil import which +from typing import ClassVar + +import setuptools +import setuptools.command.build_ext +import setuptools.command.build_py +import setuptools.command.develop TOP_DIR = os.path.realpath(os.path.dirname(__file__)) SRC_DIR = os.path.join(TOP_DIR, "paddle2onnx") @@ -60,7 +63,7 @@ @contextmanager def cd(path): if not os.path.isabs(path): - raise RuntimeError("Can only cd to absolute path, got: {}".format(path)) + raise RuntimeError(f"Can only cd to absolute path, got: {path}") orig_path = os.getcwd() os.chdir(path) try: @@ -83,8 +86,8 @@ class cmake_build(setuptools.Command): to `setup.py build`. By default all CPUs are used. """ - user_options = [ - (str("jobs="), str("j"), str("Specifies the number of jobs to use with make")) + user_options: ClassVar[list[tuple[str, str, str]]] = [ + ("jobs=", "j", "Specifies the number of jobs to use with make") ] built = False @@ -93,8 +96,7 @@ def initialize_options(self): self.jobs = None def finalize_options(self): - if sys.version_info[0] >= 3: - self.set_undefined_options("build", ("parallel", "jobs")) + self.set_undefined_options("build", ("parallel", "jobs")) if self.jobs is None and os.getenv("MAX_JOBS") is not None: self.jobs = os.getenv("MAX_JOBS") self.jobs = multiprocessing.cpu_count() if self.jobs is None else int(self.jobs) @@ -107,11 +109,11 @@ def run(self): # configure cmake_args = [ CMAKE, - "-DPYTHON_INCLUDE_DIR={}".format(sysconfig.get_python_inc()), - "-DPYTHON_EXECUTABLE={}".format(sys.executable), + f"-DPYTHON_INCLUDE_DIR={sysconfig.get_python_inc()}", + f"-DPYTHON_EXECUTABLE={sys.executable}", "-DBUILD_PADDLE2ONNX_PYTHON=ON", "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", - "-DONNX_NAMESPACE={}".format(ONNX_NAMESPACE), + f"-DONNX_NAMESPACE={ONNX_NAMESPACE}", "-DPY_EXT_SUFFIX={}".format( sysconfig.get_config_var("EXT_SUFFIX") or "" ), @@ -119,7 +121,7 @@ def run(self): str(sys.version_info[0]) + "." + str(sys.version_info[1]) ), ] - cmake_args.append("-DCMAKE_BUILD_TYPE=%s" % build_type) + cmake_args.append(f"-DCMAKE_BUILD_TYPE={build_type}") cmake_args.append("-DCMAKE_POLICY_VERSION_MINIMUM=3.5") if WINDOWS: cmake_args.extend( @@ -127,27 +129,22 @@ def run(self): # we need to link with libpython on windows, so # passing python version to window in order to # find python in cmake - "-DPY_VERSION={}".format( - "{0}.{1}".format(*sys.version_info[:2]) - ), + "-DPY_VERSION={}".format("{}.{}".format(*sys.version_info[:2])), ] ) if platform.architecture()[0] == "64bit": cmake_args.extend(["-A", "x64", "-T", "host=x64"]) else: cmake_args.extend(["-A", "Win32", "-T", "host=x86"]) - cmake_args.extend(["-G", "Visual Studio 16 2019"]) else: cmake_args.append( - "-DPYTHON_LIBRARY={}".format( - sysconfig.get_python_lib(standard_lib=True) - ) + f"-DPYTHON_LIBRARY={sysconfig.get_python_lib(standard_lib=True)}" ) if "CMAKE_ARGS" in os.environ: extra_cmake_args = shlex.split(os.environ["CMAKE_ARGS"]) # prevent crossfire with downstream scripts del os.environ["CMAKE_ARGS"] - log.info("Extra cmake args: {}".format(extra_cmake_args)) + log.info(f"Extra cmake args: {extra_cmake_args}") cmake_args.extend(extra_cmake_args) cmake_args.append(TOP_DIR) subprocess.check_call(cmake_args) @@ -155,7 +152,7 @@ def run(self): build_args = [CMAKE, "--build", os.curdir] if WINDOWS: build_args.extend(["--config", build_type]) - build_args.extend(["--", "/maxcpucount:{}".format(self.jobs)]) + build_args.extend(["--", f"/maxcpucount:{self.jobs}"]) else: build_args.extend(["--", "-j", str(self.jobs)]) subprocess.check_call(build_args) @@ -189,14 +186,10 @@ def build_extensions(self): os.path.realpath(self.build_lib), "paddle2onnx", filename ) if platform.system() == "Darwin": - command = "install_name_tool -change @loader_path/../libs/ @loader_path/../paddle/base/libpaddle.so {}".format( - src - ) + command = f"install_name_tool -change @loader_path/../libs/ @loader_path/../paddle/base/libpaddle.so {src}" if os.system(command) != 0: raise Exception( - "Failed to change library paths using command: '{}'".format( - command - ) + f"Failed to change library paths using command: '{command}'" ) self.copy_file(src, dst) @@ -211,7 +204,7 @@ def build_extensions(self): ################################################################################ ext_modules = [ - setuptools.Extension(name=str("paddle2onnx.paddle2onnx_cpp2py_export"), sources=[]) + setuptools.Extension(name="paddle2onnx.paddle2onnx_cpp2py_export", sources=[]) ] ################################################################################ diff --git a/tests/auto_scan_test.py b/tests/auto_scan_test.py index 4999903f3..af0857774 100755 --- a/tests/auto_scan_test.py +++ b/tests/auto_scan_test.py @@ -12,18 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import unittest +import copy +import logging import os import time -import logging -import paddle -from hypothesis import given, settings, HealthCheck +import unittest +from inspect import isfunction +from itertools import product + import hypothesis.strategies as st +import numpy as np +from hypothesis import HealthCheck, given, settings from onnxbase import APIOnnx, randtool -from itertools import product -import copy -from inspect import isfunction + +import paddle paddle.set_device("cpu") @@ -62,7 +64,7 @@ class BaseNet(paddle.nn.Layer): """ def __init__(self, config): - super(BaseNet, self).__init__() + super().__init__() self.config = copy.copy(config) def forward(self, *args, **kwargs): @@ -71,20 +73,21 @@ def forward(self, *args, **kwargs): class OPConvertAutoScanTest(unittest.TestCase): def __init__(self, *args, **kwargs): - super(OPConvertAutoScanTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) np.random.seed(1024) - paddle.enable_static() self.num_ran_models = 0 # @_test_with_pir def run_and_statis( self, max_examples=100, - opset_version=[7, 9, 15], + opset_version=None, reproduce=None, min_success_num=25, max_duration=-1, ): + if opset_version is None: + opset_version = [7, 9, 15] self.num_ran_models = 0 if os.getenv("CE_STAGE", "OFF") == "ON": max_examples *= 10 @@ -113,49 +116,45 @@ def run_test(configs): loop_func = given(generator())(run_test) if reproduce is not None: loop_func = reproduce(loop_func) - logging.info("Start to running test of {}".format(type(self))) + logging.info(f"Start to running test of {type(self)}") paddle.disable_static() loop_func() logging.info("===================Statistical Information===================") - logging.info("Number of Generated Programs: {}".format(self.num_ran_models)) + logging.info(f"Number of Generated Programs: {self.num_ran_models}") successful_ran_programs = int(self.num_ran_models) if successful_ran_programs < min_success_num: logging.warning("satisfied_programs = ran_programs") logging.error( - "At least {} programs need to ran successfully, but now only about {} programs satisfied.".format( - min_success_num, successful_ran_programs - ) + f"At least {min_success_num} programs need to ran successfully, but now only about {successful_ran_programs} programs satisfied." ) - assert False + raise AssertionError() used_time = time.time() - start_time - logging.info("Used time: {} s".format(round(used_time, 2))) + logging.info(f"Used time: {round(used_time, 2)} s") if max_duration > 0 and used_time > max_duration: logging.error( - "The duration exceeds {} seconds, if this is neccessary, try to set a larger number for parameter `max_duration`.".format( - max_duration - ) + f"The duration exceeds {max_duration} seconds, if this is neccessary, try to set a larger number for parameter `max_duration`." ) - assert False + raise AssertionError() def run_test(self, configs): config, models = configs - logging.info("Run configs: {}".format(config)) - - assert "op_names" in config.keys(), "config must include op_names in dict keys" - assert ( - "test_data_shapes" in config.keys() - ), "config must include test_data_shapes in dict keys" - assert ( - "test_data_types" in config.keys() - ), "config must include test_data_types in dict keys" - assert ( - "opset_version" in config.keys() - ), "config must include opset_version in dict keys" - assert ( - "input_spec_shape" in config.keys() - ), "config must include input_spec_shape in dict keys" + logging.info(f"Run configs: {config}") + + assert "op_names" in config, "config must include op_names in dict keys" + assert "test_data_shapes" in config, ( + "config must include test_data_shapes in dict keys" + ) + assert "test_data_types" in config, ( + "config must include test_data_types in dict keys" + ) + assert "opset_version" in config, ( + "config must include opset_version in dict keys" + ) + assert "input_spec_shape" in config, ( + "config must include input_spec_shape in dict keys" + ) op_names = config["op_names"] test_data_shapes = config["test_data_shapes"] @@ -164,7 +163,7 @@ def run_test(self, configs): input_specs = config["input_spec_shape"] use_gpu = False - if "use_gpu" in config.keys(): + if "use_gpu" in config: use_gpu = config["use_gpu"] self.num_ran_models += 1 @@ -178,9 +177,9 @@ def run_test(self, configs): if len(opset_version) == 1 and len(models) != len(opset_version): opset_version = opset_version * len(models) - assert len(models) == len( - op_names - ), "Length of models should be equal to length of op_names" + assert len(models) == len(op_names), ( + "Length of models should be equal to length of op_names" + ) input_type_list = None if len(test_data_types) > 1: @@ -195,9 +194,9 @@ def run_test(self, configs): delta = 1e-5 rtol = 1e-5 - if "delta" in config.keys(): + if "delta" in config: delta = config["delta"] - if "rtol" in config.keys(): + if "rtol" in config: rtol = config["rtol"] for i, model in enumerate(models): @@ -213,7 +212,7 @@ def run_test(self, configs): use_gpu, ) for input_type in input_type_list: - input_tensors = list() + input_tensors = [] for j, shape in enumerate(test_data_shapes): # Determine whether it is a user-defined data generation function if isfunction(shape): @@ -240,9 +239,7 @@ def run_test(self, configs): ) ) obj.set_input_data("input_data", tuple(input_tensors)) - logging.info( - "Now Run >>> dtype: {}, op_name: {}".format(input_type, op_names[i]) - ) + logging.info(f"Now Run >>> dtype: {input_type}, op_name: {op_names[i]}") obj.run() if len(input_type_list) == 0: obj.run() diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..aa5836234 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,5 @@ +import sys +from pathlib import Path + +# Add tests directory to path so test modules can import each other +sys.path.insert(0, str(Path(__file__).parent)) diff --git a/tests/detection_ops/nms.py b/tests/detection_ops/nms.py index 9a1509d36..e4de96114 100644 --- a/tests/detection_ops/nms.py +++ b/tests/detection_ops/nms.py @@ -13,8 +13,8 @@ # limitations under the License. import paddle -from paddle.base.framework import in_dygraph_mode from paddle.base import core +from paddle.base.framework import in_dygraph_mode from paddle.base.layer_helper import LayerHelper @@ -149,42 +149,41 @@ class number index = None return output, nms_rois_num, index - else: - output = helper.create_variable_for_type_inference(dtype=bboxes.dtype) - index = helper.create_variable_for_type_inference(dtype="int32") + output = helper.create_variable_for_type_inference(dtype=bboxes.dtype) + index = helper.create_variable_for_type_inference(dtype="int32") - inputs = {"BBoxes": bboxes, "Scores": scores} - outputs = {"Out": output, "Index": index} + inputs = {"BBoxes": bboxes, "Scores": scores} + outputs = {"Out": output, "Index": index} - if rois_num is not None: - inputs["RoisNum"] = rois_num + if rois_num is not None: + inputs["RoisNum"] = rois_num - if return_rois_num: - nms_rois_num = helper.create_variable_for_type_inference(dtype="int32") - outputs["NmsRoisNum"] = nms_rois_num + if return_rois_num: + nms_rois_num = helper.create_variable_for_type_inference(dtype="int32") + outputs["NmsRoisNum"] = nms_rois_num - helper.append_op( - type="multiclass_nms3", - inputs=inputs, - attrs={ - "background_label": background_label, - "score_threshold": score_threshold, - "nms_top_k": nms_top_k, - "nms_threshold": nms_threshold, - "keep_top_k": keep_top_k, - "nms_eta": nms_eta, - "normalized": normalized, - }, - outputs=outputs, - ) - output.stop_gradient = True - index.stop_gradient = True - if not return_index: - index = None - if not return_rois_num: - nms_rois_num = None + helper.append_op( + type="multiclass_nms3", + inputs=inputs, + attrs={ + "background_label": background_label, + "score_threshold": score_threshold, + "nms_top_k": nms_top_k, + "nms_threshold": nms_threshold, + "keep_top_k": keep_top_k, + "nms_eta": nms_eta, + "normalized": normalized, + }, + outputs=outputs, + ) + output.stop_gradient = True + index.stop_gradient = True + if not return_index: + index = None + if not return_rois_num: + nms_rois_num = None - return ( - output, - nms_rois_num, - ) + return ( + output, + nms_rois_num, + ) diff --git a/tests/fake_quant.py b/tests/fake_quant.py index 0d83b3c08..a5eae6235 100755 --- a/tests/fake_quant.py +++ b/tests/fake_quant.py @@ -14,31 +14,45 @@ # come from: https://github.com/PaddlePaddle/PaddleSlim/blob/develop/paddleslim/auto_compression/utils/fake_ptq.py import os + import paddle -from paddle.fluid.framework import IrGraph from paddle.framework import core -from paddle.static.quantization import ( - QuantizationTransformPass, - QuantizationTransformPassV2, - AddQuantDequantPass, - AddQuantDequantPassV2, - QuantizationFreezePass, - QuantWeightPass, -) -from paddle.static.quantization import utils try: - from paddle.static.quantization import quant_config - - TRANSFORM_PASS_OP_TYPES = list( - quant_config.SUPPORT_WEIGHT_QUANTIZATION_OP_DICT.keys() + from paddle.base.framework import IrGraph + + _HAS_IR_GRAPH = True +except (ImportError, AttributeError): + try: + from paddle.fluid.framework import IrGraph + + _HAS_IR_GRAPH = True + except (ImportError, AttributeError): + _HAS_IR_GRAPH = False + +if _HAS_IR_GRAPH: + from paddle.static.quantization import ( + AddQuantDequantPass, + AddQuantDequantPassV2, + QuantizationFreezePass, + QuantizationTransformPass, + QuantizationTransformPassV2, + QuantWeightPass, + utils, ) - QUANT_DEQUANT_PASS_OP_TYPES = list( - quant_config.SUPPORT_ACT_QUANTIZATION_OP_DICT.keys() - ) -except: # noqa: E722 - TRANSFORM_PASS_OP_TYPES = utils._weight_supported_quantizable_op_type - QUANT_DEQUANT_PASS_OP_TYPES = utils._act_supported_quantizable_op_type + + try: + from paddle.static.quantization import quant_config + + TRANSFORM_PASS_OP_TYPES = list( + quant_config.SUPPORT_WEIGHT_QUANTIZATION_OP_DICT.keys() + ) + QUANT_DEQUANT_PASS_OP_TYPES = list( + quant_config.SUPPORT_ACT_QUANTIZATION_OP_DICT.keys() + ) + except Exception: + TRANSFORM_PASS_OP_TYPES = utils._weight_supported_quantizable_op_type + QUANT_DEQUANT_PASS_OP_TYPES = utils._act_supported_quantizable_op_type from paddle.static import load_inference_model @@ -49,7 +63,7 @@ def post_quant_fake( model_filename=None, params_filename=None, save_model_path=None, - quantizable_op_type=["conv2d", "depthwise_conv2d", "mul"], + quantizable_op_type=None, is_full_quantize=False, activation_bits=8, weight_bits=8, @@ -68,6 +82,13 @@ def post_quant_fake( params_filename='params', save_model_path='fake_quant') """ + if not _HAS_IR_GRAPH: + raise RuntimeError( + "post_quant_fake requires paddle.fluid.framework.IrGraph which " + "has been removed in PaddlePaddle 3.x" + ) + if quantizable_op_type is None: + quantizable_op_type = ["conv2d", "depthwise_conv2d", "mul"] activation_quantize_type = "range_abs_max" weight_quantize_type = "channel_wise_abs_max" _dynamic_quantize_op_type = ["lstm"] diff --git a/tests/onnx/base_expect.py b/tests/onnx/base_expect.py index 8137ab876..08afed8d9 100644 --- a/tests/onnx/base_expect.py +++ b/tests/onnx/base_expect.py @@ -18,9 +18,7 @@ from __future__ import annotations from copy import deepcopy -from typing import Any, Callable, Sequence - -import numpy as np +from typing import TYPE_CHECKING, Any import onnx from onnx.onnx_pb import ( @@ -33,6 +31,11 @@ TypeProto, ) +if TYPE_CHECKING: + from collections.abc import Callable, Sequence + + import numpy as np + _NodeTestCases = [] _TargetOpType = None _DiffOpTypes = None @@ -76,11 +79,11 @@ def _rename_edges_helper( for sparse_init_desc in new_graph.sparse_initializer: sg_rename[sparse_init_desc.values.name] = ( sparse_init_desc.values.name - ) = (prefix + sparse_init_desc.values.name) + ) = prefix + sparse_init_desc.values.name for sparse_init_desc in new_graph.sparse_initializer: sg_rename[sparse_init_desc.indices.name] = ( sparse_init_desc.indices.name - ) = (prefix + sparse_init_desc.indices.name) + ) = prefix + sparse_init_desc.indices.name def subgraph_rename_helper(name: str) -> Any: if name in sg_rename: # noqa: B023 @@ -124,15 +127,14 @@ def function_expand_helper( def rename_helper(internal_name: str) -> Any: if internal_name in io_names_map: return io_names_map[internal_name] - elif internal_name == "": + if internal_name == "": return "" return op_prefix + internal_name - new_node_list = [ + return [ _rename_edges_helper(internal_node, rename_helper, attribute_map, op_prefix) for internal_node in function_proto.node ] - return new_node_list def function_testcase_helper( @@ -186,7 +188,7 @@ def _extract_value_info( raise NotImplementedError( "_extract_value_info: both input and type_proto arguments cannot be None." ) - elif isinstance(input, list): + if isinstance(input, list): elem_type = onnx.helper.np_dtype_to_tensor_dtype(input[0].dtype) shape = None tensor_type_proto = onnx.helper.make_tensor_type_proto(elem_type, shape) @@ -208,9 +210,7 @@ def _make_test_model_gen_version(graph: GraphProto, **kwargs: Any) -> ModelProto latest_onnx_version, latest_ml_version, latest_training_version, - ) = onnx.helper.VERSION_TABLE[-1][ - 2:5 - ] # type: ignore + ) = onnx.helper.VERSION_TABLE[-1][2:5] # type: ignore if "opset_imports" in kwargs: for opset in kwargs["opset_imports"]: # If the test model uses an unreleased opset version (latest_version+1), @@ -280,12 +280,14 @@ def expect( del kwargs["output_type_protos"] inputs_vi = [ _extract_value_info(arr, arr_name, input_type) - for arr, arr_name, input_type in zip(inputs, present_inputs, input_type_protos) + for arr, arr_name, input_type in zip( + inputs, present_inputs, input_type_protos, strict=False + ) ] outputs_vi = [ _extract_value_info(arr, arr_name, output_type) for arr, arr_name, output_type in zip( - outputs, present_outputs, output_type_protos + outputs, present_outputs, output_type_protos, strict=False ) ] graph = onnx.helper.make_graph( diff --git a/tests/onnx/export_if.py b/tests/onnx/export_if.py index 508b5a7a4..383506cd7 100644 --- a/tests/onnx/export_if.py +++ b/tests/onnx/export_if.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import onnx import numpy as np +import onnx from base_expect import expect if __name__ == "__main__": diff --git a/tests/onnxbase.py b/tests/onnxbase.py index 46baf3aa0..6ae935fae 100644 --- a/tests/onnxbase.py +++ b/tests/onnxbase.py @@ -12,18 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import onnx -from inspect import isfunction +import contextlib import logging -from onnxruntime import InferenceSession import os +import shutil +from functools import wraps +from inspect import isfunction + import numpy as np +import onnx import paddle -import paddle2onnx import paddle.static as static +from onnxruntime import InferenceSession + +import paddle2onnx from paddle2onnx.convert import dygraph2onnx -import shutil -from functools import wraps def _test_with_pir(func): @@ -57,9 +60,7 @@ def compare_data(result_data, expect_data, delta, rtol): # 输出数据类型错误 if result_data.dtype != result_data.dtype: logging.error( - "Different output data types! res type is: {}, and expect type is: {}".format( - result_data.dtype, expect_data.dtype - ) + f"Different output data types! res type is: {result_data.dtype}, and expect type is: {expect_data.dtype}" ) return False @@ -68,7 +69,7 @@ def compare_data(result_data, expect_data, delta, rtol): diff = abs(result_data.astype("int32") - expect_data.astype("int32")) else: diff = abs(result_data - expect_data) - logging.error("Output has diff! max diff: {}".format(np.amax(diff))) + logging.error(f"Output has diff! max diff: {np.amax(diff)}") return False @@ -92,7 +93,7 @@ def compare(result, expect, delta=1e-10, rtol=1e-10): expect = expect[0] if isinstance(expect, paddle.Tensor): - expect = expect.numpy() + expect = np.array(expect) else: expect = np.array(expect) @@ -104,19 +105,19 @@ def compare(result, expect, delta=1e-10, rtol=1e-10): # Compare the actual shape with the expected shape and determine if the output results are correct. res_shape = compare_shape(result, expect) - assert res_data, "result: {} != expect: {}".format(result, expect) - assert res_shape, "result.shape: {} != expect.shape: {}".format( - result.shape, expect.shape + assert res_data, f"result: {result} != expect: {expect}" + assert res_shape, ( + f"result.shape: {result.shape} != expect.shape: {expect.shape}" + ) + assert result.dtype == expect.dtype, ( + f"result.dtype: {result.dtype} != expect.dtype: {expect.dtype}" ) - assert ( - result.dtype == expect.dtype - ), "result.dtype: {} != expect.dtype: {}".format(result.dtype, expect.dtype) elif isinstance(result, list) and len(result) > 1: for i in range(len(result)): if isinstance(result[i], (np.generic, np.ndarray)): compare(result[i], expect[i], delta, rtol) else: - compare(result[i].numpy(), expect[i], delta, rtol) + compare(np.array(result[i]), expect[i], delta, rtol) elif len(result) == 1: compare(result[0], expect, delta, rtol) @@ -128,11 +129,12 @@ def randtool(dtype, low, high, shape): if dtype == "int": return np.random.randint(low, high, shape) - elif dtype == "float": + if dtype == "float": return low + (high - low) * np.random.random(shape) - elif dtype == "bool": + if dtype == "bool": return np.random.randint(low, high, shape).astype("bool") + return None class BuildFunc(paddle.nn.Layer): @@ -141,7 +143,7 @@ class BuildFunc(paddle.nn.Layer): """ def __init__(self, inner_func, **super_param): - super(BuildFunc, self).__init__() + super().__init__() self.inner_func = inner_func self._super_param = super_param @@ -149,8 +151,7 @@ def forward(self, inputs): """ forward """ - x = self.inner_func(inputs, **self._super_param) - return x + return self.inner_func(inputs, **self._super_param) class BuildClass(paddle.nn.Layer): @@ -159,26 +160,17 @@ class BuildClass(paddle.nn.Layer): """ def __init__(self, inner_class, **super_param): - super(BuildClass, self).__init__() + super().__init__() self.inner_class = inner_class(**super_param) def forward(self, inputs): """ forward """ - x = self.inner_class(inputs) - return x + return self.inner_class(inputs) dtype_map = { - paddle.base.core.VarDesc.VarType.FP32: np.float32, - paddle.base.core.VarDesc.VarType.FP16: np.float16, - paddle.base.core.VarDesc.VarType.FP64: np.float64, - paddle.base.core.VarDesc.VarType.INT64: np.int64, - paddle.base.core.VarDesc.VarType.INT32: np.int32, - paddle.base.core.VarDesc.VarType.INT16: np.int16, - paddle.base.core.VarDesc.VarType.INT8: np.int8, - paddle.base.core.VarDesc.VarType.BOOL: np.bool_, paddle.base.core.DataType.FLOAT32: np.float32, paddle.base.core.DataType.FLOAT16: np.float16, paddle.base.core.DataType.FLOAT64: np.float64, @@ -189,8 +181,23 @@ def forward(self, inputs): paddle.base.core.DataType.BOOL: np.bool_, } +# VarDesc.VarType is deprecated in PaddlePaddle 3.x but may still exist in older versions +with contextlib.suppress(AttributeError): + dtype_map.update( + { + paddle.base.core.VarDesc.VarType.FP32: np.float32, + paddle.base.core.VarDesc.VarType.FP16: np.float16, + paddle.base.core.VarDesc.VarType.FP64: np.float64, + paddle.base.core.VarDesc.VarType.INT64: np.int64, + paddle.base.core.VarDesc.VarType.INT32: np.int32, + paddle.base.core.VarDesc.VarType.INT16: np.int16, + paddle.base.core.VarDesc.VarType.INT8: np.int8, + paddle.base.core.VarDesc.VarType.BOOL: np.bool_, + } + ) + -class APIOnnx(object): +class APIOnnx: """ paddle API transfer to onnx """ @@ -200,13 +207,17 @@ def __init__( func, file_name, ver_list, - ops=[], - input_spec_shape=[], + ops=None, + input_spec_shape=None, delta=1e-5, rtol=1e-5, use_gpu=False, **sup_params, ): + if input_spec_shape is None: + input_spec_shape = [] + if ops is None: + ops = [] self.ops = ops if isinstance(self.ops, str): self.ops = [self.ops] @@ -265,7 +276,7 @@ def set_input_data(self, group_name, *args): float(in_data), dtype=dtype_map[in_data.dtype] ) else: - self.input_feed[str(i)] = tensor_data.numpy() + self.input_feed[str(i)] = np.array(tensor_data) i += 1 else: if isinstance(in_data, tuple): @@ -281,7 +292,7 @@ def set_input_data(self, group_name, *args): float(in_data), dtype=dtype_map[in_data.dtype] ) else: - self.input_feed[str(i)] = in_data.numpy() + self.input_feed[str(i)] = np.array(in_data) i += 1 @@ -295,14 +306,12 @@ def set_input_spec(self): if len(self.input_spec_shape) == 0: return self.input_spec.clear() - i = 0 - for shape in self.input_spec_shape: + for i, shape in enumerate(self.input_spec_shape): self.input_spec.append( paddle.static.InputSpec( shape=shape, dtype=self.input_dtype[i], name=str(i) ) ) - i += 1 def _mkdir(self): """ @@ -363,8 +372,7 @@ def _mk_onnx_res(self, ver): input_feed = {} if len(model.graph.input) == 0: return sess.run(output_names=None, input_feed=input_feed) - ort_outs = sess.run(output_names=None, input_feed=self.input_feed) - return ort_outs + return sess.run(output_names=None, input_feed=self.input_feed) def add_kwargs_to_dict(self, group_name, **kwargs): """ @@ -387,7 +395,7 @@ def check_ops(self, version): included = False paddle_op_list = [] assert len(self.ops) == 1, "You have to set one op name" - for key, node in paddle_graph.node_map.items(): + for node in paddle_graph.node_map.values(): op_type = node.type op_type = op_type.replace("depthwise_", "") if op_type == self.ops[0]: @@ -396,8 +404,8 @@ def check_ops(self, version): if len(paddle_graph.node_map.keys()) == 0 and self.ops[0] == "": included = True - assert included is True, "{} op in not in convert OPs, all OPs :{}".format( - self.ops, paddle_op_list + assert included is True, ( + f"{self.ops} op in not in convert OPs, all OPs :{paddle_op_list}" ) # TODO: PaddlePaddle 2.6 has modified the ParseFromString API, and it cannot be simply replaced with @@ -430,14 +438,19 @@ def clip_extra_program_only(self, orig_program_path, clipped_program_path): Returns: None """ - paddle.enable_static() - origin_program_bytes = static.io.load_from_file(orig_program_path) - origin_program = static.io.deserialize_program(origin_program_bytes) - clipped_program = origin_program._remove_training_info(clip_extra=True) - clipped_program_bytes = static.io._serialize_program(clipped_program) - static.io.save_to_file(clipped_program_path, clipped_program_bytes) - paddle.disable_static() - paddle.set_device("cpu") + was_static = paddle.in_dynamic_mode() is False + if not was_static: + paddle.enable_static() + try: + origin_program_bytes = static.io.load_from_file(orig_program_path) + origin_program = static.io.deserialize_program(origin_program_bytes) + clipped_program = origin_program._remove_training_info(clip_extra=True) + clipped_program_bytes = static.io._serialize_program(clipped_program) + static.io.save_to_file(clipped_program_path, clipped_program_bytes) + finally: + if not was_static: + paddle.disable_static() + paddle.set_device("cpu") def run(self): """ @@ -451,9 +464,9 @@ def run(self): for place in self.places: paddle.set_device(place) exp = self._mk_dygraph_exp(self._func) - assert ( - len(self.ops) <= 1 - ), "Need to make sure the number of ops in config is 1." + assert len(self.ops) <= 1, ( + "Need to make sure the number of ops in config is 1." + ) # Save Paddle Inference model if os.path.exists(self.name): diff --git a/tests/quantize_ops.py b/tests/quantize_ops.py index 7cfb9054a..716bc97b7 100755 --- a/tests/quantize_ops.py +++ b/tests/quantize_ops.py @@ -13,9 +13,9 @@ # limitations under the License. import paddle +from paddle import _legacy_C_ops from paddle.base.framework import in_dygraph_mode from paddle.base.layer_helper import LayerHelper -from paddle import _legacy_C_ops @paddle.jit.not_to_static @@ -25,20 +25,19 @@ def quantize_linear(x, scale, zero_point, bit_length=8, quant_axis=-1, name=None attrs = ("bit_length", bit_length, "quant_axis", quant_axis) if in_dygraph_mode(): return _legacy_C_ops.quantize_linear(x, scale, zero_point, *attrs) - else: - output = helper.create_variable_for_type_inference(dtype=x.dtype) + output = helper.create_variable_for_type_inference(dtype=x.dtype) - inputs = {"X": x, "Scale": scale, "ZeroPoint": zero_point} - outputs = {"Y": output} + inputs = {"X": x, "Scale": scale, "ZeroPoint": zero_point} + outputs = {"Y": output} - helper.append_op( - type="quantize_linear", - inputs=inputs, - attrs={"bit_length": bit_length, "quant_axis": quant_axis}, - outputs=outputs, - ) - output.stop_gradient = True - return output + helper.append_op( + type="quantize_linear", + inputs=inputs, + attrs={"bit_length": bit_length, "quant_axis": quant_axis}, + outputs=outputs, + ) + output.stop_gradient = True + return output @paddle.jit.not_to_static @@ -48,17 +47,16 @@ def dequantize_linear(x, scale, zero_point, bit_length=8, quant_axis=-1, name=No attrs = ("bit_length", bit_length, "quant_axis", quant_axis) if in_dygraph_mode(): return _legacy_C_ops.dequantize_linear(x, scale, zero_point, *attrs) - else: - output = helper.create_variable_for_type_inference(dtype=x.dtype) - - inputs = {"X": x, "Scale": scale, "ZeroPoint": zero_point} - outputs = {"Y": output} - - helper.append_op( - type="dequantize_linear", - inputs=inputs, - attrs={"bit_length": bit_length, "quant_axis": quant_axis}, - outputs=outputs, - ) - output.stop_gradient = True - return output + output = helper.create_variable_for_type_inference(dtype=x.dtype) + + inputs = {"X": x, "Scale": scale, "ZeroPoint": zero_point} + outputs = {"Y": output} + + helper.append_op( + type="dequantize_linear", + inputs=inputs, + attrs={"bit_length": bit_length, "quant_axis": quant_axis}, + outputs=outputs, + ) + output.stop_gradient = True + return output diff --git a/tests/test_Conv2D_Dropout.py b/tests/test_Conv2D_Dropout.py index 0731a0d24..b9c28e4b0 100644 --- a/tests/test_Conv2D_Dropout.py +++ b/tests/test_Conv2D_Dropout.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -34,7 +33,7 @@ def __init__( bias_attr=None, data_format="NCHW", ): - super(Net, self).__init__() + super().__init__() self._bn = paddle.nn.Conv2D( in_channels=1, out_channels=2, @@ -55,8 +54,7 @@ def forward(self, inputs): forward """ x = self._bn(inputs) - x = self._drop(x) - return x + return self._drop(x) @_test_with_pir diff --git a/tests/test_abs.py b/tests/test_abs.py index 0ac9eedc7..68bf2a1c9 100644 --- a/tests/test_abs.py +++ b/tests/test_abs.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.abs(inputs) - return x + return paddle.abs(inputs) @_test_with_pir diff --git a/tests/test_acos.py b/tests/test_acos.py index 81dad3295..7bb536612 100644 --- a/tests/test_acos.py +++ b/tests/test_acos.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.acos(inputs) - return x + return paddle.acos(inputs) def test_acos_7(): diff --git a/tests/test_add.py b/tests/test_add.py index f0ee1fb4e..936f6e621 100644 --- a/tests/test_add.py +++ b/tests/test_add.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.add(inputs, inputs_) - return x + return paddle.add(inputs, inputs_) @_test_with_pir diff --git a/tests/test_argmax.py b/tests/test_argmax.py index d3655b158..63e34e9eb 100755 --- a/tests/test_argmax.py +++ b/tests/test_argmax.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, dtype="int64"): - super(Net, self).__init__() + super().__init__() self.dtype = dtype def forward(self, inputs): """ forward """ - x = paddle.argmax(inputs, axis=0, dtype=self.dtype) - return x + return paddle.argmax(inputs, axis=0, dtype=self.dtype) @_test_with_pir diff --git a/tests/test_argmin.py b/tests/test_argmin.py index 722232e2c..e2c7779cf 100644 --- a/tests/test_argmin.py +++ b/tests/test_argmin.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self, axis=None, keepdim=False): - super(Net, self).__init__() + super().__init__() self.axis = axis self.keepdim = keepdim @@ -31,8 +31,7 @@ def forward(self, inputs): """ forward """ - x = paddle.argmin(inputs, axis=self.axis, keepdim=self.keepdim) - return x + return paddle.argmin(inputs, axis=self.axis, keepdim=self.keepdim) def test_argmin_9(): diff --git a/tests/test_argsort.py b/tests/test_argsort.py index 8260d6338..91ad04930 100644 --- a/tests/test_argsort.py +++ b/tests/test_argsort.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self, axis=-1, descending=False): - super(Net, self).__init__() + super().__init__() self.axis = axis self.descending = descending @@ -31,8 +31,7 @@ def forward(self, inputs): """ forward """ - x = paddle.argsort(inputs, axis=self.axis, descending=self.descending) - return x + return paddle.argsort(inputs, axis=self.axis, descending=self.descending) @_test_with_pir diff --git a/tests/test_array_to_tensor.py b/tests/test_array_to_tensor.py index 445bab6e4..4e9772610 100644 --- a/tests/test_array_to_tensor.py +++ b/tests/test_array_to_tensor.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_only_pir global_config = { "axis": 0, @@ -24,7 +24,7 @@ class BaseNet(paddle.nn.Layer): def __init__(self, axis, use_stack): - super(BaseNet, self).__init__() + super().__init__() self.axis = axis self.use_stack = use_stack diff --git a/tests/test_asin.py b/tests/test_asin.py index fe25dc74c..d09d98e23 100644 --- a/tests/test_asin.py +++ b/tests/test_asin.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.asin(inputs) - return x + return paddle.asin(inputs) def test_asin_9(): diff --git a/tests/test_assign.py b/tests/test_assign.py index ad425ff5b..79d410c94 100644 --- a/tests/test_assign.py +++ b/tests/test_assign.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.assign(inputs) - return x + return paddle.assign(inputs) @_test_with_pir diff --git a/tests/test_atan.py b/tests/test_atan.py index 5099b351a..007744b91 100644 --- a/tests/test_atan.py +++ b/tests/test_atan.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.atan(inputs) - return x + return paddle.atan(inputs) def test_atan_9(): diff --git a/tests/test_auto_scan_argminmax.py b/tests/test_auto_scan_argminmax.py index 26e6b3e5e..817294b8a 100755 --- a/tests/test_auto_scan_argminmax.py +++ b/tests/test_auto_scan_argminmax.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + op_api_map = { "arg_min": paddle.argmin, "arg_max": paddle.argmax, @@ -42,13 +44,12 @@ def forward(self, inputs): axis = paddle.assign(self.config["axis"]) else: axis = self.config["axis"] - x = op_api_map[self.config["op_names"]]( + return op_api_map[self.config["op_names"]]( inputs, axis=axis, keepdim=self.config["keep_dim"], dtype=self.config["out_dtype"], ) - return x class TestArgMinMaxConvert(OPConvertAutoScanTest): @@ -88,10 +89,10 @@ def sample_convert_config(self, draw): "rtol": 1e-4, } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) diff --git a/tests/test_auto_scan_argsort.py b/tests/test_auto_scan_argsort.py index 8858f859c..9dd9f2bf3 100644 --- a/tests/test_auto_scan_argsort.py +++ b/tests/test_auto_scan_argsort.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -30,10 +32,9 @@ def forward(self, input): forward """ - x = paddle.argsort( + return paddle.argsort( input, axis=self.config["axis"], descending=self.config["descending"] ) - return x class TestArgsortConvert(OPConvertAutoScanTest): @@ -61,13 +62,9 @@ def generator_data(): for i in range(len(input_shape)): t = t * input_shape[i] input_data = np.array(random.sample(range(-5000, 5000), t)) - input_data = input_data.reshape(input_shape) - return input_data + return input_data.reshape(input_shape) - if descending: - opset_version = [7, 10, 11, 15] - else: - opset_version = [11, 15] + opset_version = [7, 10, 11, 15] if descending else [11, 15] config = { "op_names": ["argsort"], "test_data_shapes": [generator_data], diff --git a/tests/test_auto_scan_assign.py b/tests/test_auto_scan_assign.py index 2117df32c..e78eb7e54 100644 --- a/tests/test_auto_scan_assign.py +++ b/tests/test_auto_scan_assign.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ diff --git a/tests/test_auto_scan_atan2.py b/tests/test_auto_scan_atan2.py index 1b00b10af..2f8c2fd9d 100755 --- a/tests/test_auto_scan_atan2.py +++ b/tests/test_auto_scan_atan2.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,8 +29,7 @@ def forward(self, input1, input2): """ forward """ - x = paddle.atan2(input1, input2) - return x + return paddle.atan2(input1, input2) class TestUnsqueezeConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_avgpool.py b/tests/test_auto_scan_avgpool.py index d2509278d..59d6f30ff 100755 --- a/tests/test_auto_scan_avgpool.py +++ b/tests/test_auto_scan_avgpool.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -33,7 +35,7 @@ def forward(self, inputs): padding = self.config["padding"] ceil_mode = self.config["ceil_mode"] data_format = self.config["data_format"] - x = paddle.nn.functional.avg_pool2d( + return paddle.nn.functional.avg_pool2d( inputs, kernel_size=kernel_size, stride=stride, @@ -41,7 +43,6 @@ def forward(self, inputs): ceil_mode=ceil_mode, data_format=data_format, ) - return x class TestMaxpool2dConvert(OPConvertAutoScanTest): @@ -122,28 +123,22 @@ def sample_convert_config(self, draw): axis=0, ).tolist() if data_format == "NCHW": - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding = [[0, 0], [0, 0], *padding1, *padding2] else: - padding = [[0, 0]] + padding1 + padding2 + [[0, 0]] + padding = [[0, 0], *padding1, *padding2, [0, 0]] else: padding = 0 if return_mask and padding_type in ["list2", "list4", "list8"]: padding = draw(st.integers(min_value=1, max_value=5)) - if return_mask: - opset_version = [[9, 15]] - else: - opset_version = [[7, 9, 15]] + opset_version = [[9, 15]] if return_mask else [[7, 9, 15]] if ceil_mode: opset_version = [10, 15] if padding == "VALID": ceil_mode = False - if return_mask: - op_names = "max_pool2d_with_index" - else: - op_names = "pool2d" + op_names = "max_pool2d_with_index" if return_mask else "pool2d" config = { "op_names": [op_names], "test_data_shapes": [input_shape], diff --git a/tests/test_auto_scan_batch_norm.py b/tests/test_auto_scan_batch_norm.py index 79531b5bd..d21d033ef 100755 --- a/tests/test_auto_scan_batch_norm.py +++ b/tests/test_auto_scan_batch_norm.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir + import paddle from paddle import ParamAttr -from onnxbase import _test_with_pir class Net(BaseNet): @@ -26,7 +28,7 @@ class Net(BaseNet): """ def __init__(self, config=None): - super(Net, self).__init__(config) + super().__init__(config) if self.config["data_format"] in ["NC", "NCL", "NCHW", "NCDHW", "NCHW"]: param_shape = [self.config["input_shape"][1]] else: @@ -65,7 +67,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.batch_norm( + return paddle.nn.functional.batch_norm( inputs, running_mean=self.mean, running_var=self.variance, @@ -76,7 +78,6 @@ def forward(self, inputs): data_format=self.config["data_format"], use_global_stats=self.config["use_global_stats"], ) - return x class TestBatchNormConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_bmm.py b/tests/test_auto_scan_bmm.py index 60a77a088..bd1d6aa11 100755 --- a/tests/test_auto_scan_bmm.py +++ b/tests/test_auto_scan_bmm.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs1, inputs2): """ forward """ - x = paddle.bmm(inputs1, inputs2) - return x + return paddle.bmm(inputs1, inputs2) class TestBmmConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_cast.py b/tests/test_auto_scan_cast.py index efa490878..af84d5c5e 100755 --- a/tests/test_auto_scan_cast.py +++ b/tests/test_auto_scan_cast.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.cast(inputs, dtype=self.config["dtype"]) - return x + return paddle.cast(inputs, dtype=self.config["dtype"]) class TestCastConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_clip.py b/tests/test_auto_scan_clip.py index e713892ef..df991b630 100755 --- a/tests/test_auto_scan_clip.py +++ b/tests/test_auto_scan_clip.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -from onnxbase import randtool import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir, randtool + import paddle -from onnxbase import _test_with_pir class Net0(BaseNet): @@ -29,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.clip(inputs, min=self.config["min"], max=self.config["max"]) - return x + return paddle.clip(inputs, min=self.config["min"], max=self.config["max"]) class Net1(BaseNet): @@ -42,8 +42,7 @@ def forward(self, inputs, max_value): """ forward """ - x = paddle.clip(inputs, min=self.config["min"], max=max_value) - return x + return paddle.clip(inputs, min=self.config["min"], max=max_value) class Net2(BaseNet): @@ -55,8 +54,7 @@ def forward(self, inputs, min_value): """ forward """ - x = paddle.clip(inputs, min=min_value, max=self.config["max"]) - return x + return paddle.clip(inputs, min=min_value, max=self.config["max"]) class Net3(BaseNet): @@ -68,8 +66,7 @@ def forward(self, inputs, min_value, max_value): """ forward """ - x = paddle.clip(inputs, min=min_value, max=max_value) - return x + return paddle.clip(inputs, min=min_value, max=max_value) class Net4(BaseNet): @@ -81,8 +78,7 @@ def forward(self, inputs): """ forward """ - x = paddle.clip(inputs) - return x + return paddle.clip(inputs) class TestClipConvert0(OPConvertAutoScanTest): @@ -101,7 +97,7 @@ def sample_convert_config(self, draw): min_num = draw(st.integers(min_value=-4.0, max_value=-1.0)) max_num = draw(st.floats(min_value=0, max_value=4.0)) - models = list() + models = [] config0 = { "op_names": ["clip"], "test_data_shapes": [input_shape], @@ -137,10 +133,9 @@ def sample_convert_config(self, draw): min_num = draw(st.floats(min_value=-4.0, max_value=-2.0)) def generator_max(): - input_data = randtool("int", 0, 10, [1]) - return input_data + return randtool("int", 0, 10, [1]) - models = list() + models = [] config1 = { "op_names": ["clip"], "test_data_shapes": [input_shape, generator_max], @@ -173,7 +168,7 @@ def sample_convert_config(self, draw): max_num = draw(st.floats(min_value=2.0, max_value=4.0)) - models = list() + models = [] config2 = { "op_names": ["clip"], "test_data_shapes": [input_shape, [1]], @@ -205,14 +200,12 @@ def sample_convert_config(self, draw): dtype = draw(st.sampled_from(["float32", "float64"])) def generator_min(): - input_data = randtool("float", -10, -1, [1]) - return input_data + return randtool("float", -10, -1, [1]) def generator_max(): - input_data = randtool("int", 0, 10, [1]) - return input_data + return randtool("int", 0, 10, [1]) - models = list() + models = [] config3 = { "op_names": ["clip"], "test_data_shapes": [input_shape, generator_min, generator_max], @@ -242,7 +235,7 @@ def sample_convert_config(self, draw): dtype = draw(st.sampled_from(["float32", "float64"])) - models = list() + models = [] config0 = { "op_names": ["clip"], "test_data_shapes": [input_shape], diff --git a/tests/test_auto_scan_concat.py b/tests/test_auto_scan_concat.py index c28d79f22..da6a8260e 100644 --- a/tests/test_auto_scan_concat.py +++ b/tests/test_auto_scan_concat.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -31,8 +33,7 @@ def forward(self, inputs1, inputs2): axis = self.config["axis"] if self.config["isTensor"]: axis = paddle.to_tensor(axis, dtype=self.config["axis_dtype"]) - x = paddle.concat([inputs1, inputs2], axis=axis) - return x + return paddle.concat([inputs1, inputs2], axis=axis) class TestConcatConvert(OPConvertAutoScanTest): @@ -45,7 +46,7 @@ def sample_convert_config(self, draw): input_shape = draw( st.lists(st.integers(min_value=4, max_value=8), min_size=2, max_size=5) ) - axis_dtype = "int64" # 只能设置为INT64,设置为INT32时会在axis_tensor后增加cast导致取不到constant数值 + axis_dtype = "int64" # 只能设置为INT64,设置为INT32时会在axis_tensor后增加cast导致取不到constant数值 dtype = draw( st.sampled_from(["float16", "float32", "float64", "int32", "int64"]) ) diff --git a/tests/test_auto_scan_conv2d.py b/tests/test_auto_scan_conv2d.py index e5a55f827..95de7aab7 100755 --- a/tests/test_auto_scan_conv2d.py +++ b/tests/test_auto_scan_conv2d.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -29,7 +31,7 @@ def forward(self, inputs, weight): """ forward """ - x = paddle.nn.functional.conv2d( + return paddle.nn.functional.conv2d( inputs, weight, stride=self.config["stride"], @@ -38,7 +40,6 @@ def forward(self, inputs, weight): groups=self.config["groups"], data_format=self.config["data_format"], ) - return x class TestConv2dConvert(OPConvertAutoScanTest): @@ -112,9 +113,9 @@ def sample_convert_config(self, draw): axis=0, ).tolist() if data_format == "NCHW": - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding = [[0, 0], [0, 0], *padding1, *padding2] else: - padding = [[0, 0]] + padding1 + padding2 + [[0, 0]] + padding = [[0, 0], *padding1, *padding2, [0, 0]] elif padding_type == "list": if draw(st.booleans()): padding = draw( diff --git a/tests/test_auto_scan_conv2d_transpose.py b/tests/test_auto_scan_conv2d_transpose.py index e1b87ee1c..5ed359d29 100755 --- a/tests/test_auto_scan_conv2d_transpose.py +++ b/tests/test_auto_scan_conv2d_transpose.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -33,7 +35,7 @@ def forward(self, inputs, weight): output_size = self.config["output_size"] else: output_size = self.config["output_size"] - x = paddle.nn.functional.conv2d_transpose( + return paddle.nn.functional.conv2d_transpose( inputs, weight, stride=self.config["stride"], @@ -43,7 +45,6 @@ def forward(self, inputs, weight): output_size=output_size, data_format=self.config["data_format"], ) - return x class TestConv2dTransposeConvert(OPConvertAutoScanTest): @@ -133,9 +134,9 @@ def sample_convert_config(self, draw): axis=0, ).tolist() if data_format == "NCHW": - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding = [[0, 0], [0, 0], *padding1, *padding2] else: - padding = [[0, 0]] + padding1 + padding2 + [[0, 0]] + padding = [[0, 0], *padding1, *padding2, [0, 0]] padding_1_1 = padding[2][0] padding_1_2 = padding[2][1] padding_2_1 = padding[3][0] diff --git a/tests/test_auto_scan_conv3d.py b/tests/test_auto_scan_conv3d.py index 572f78abc..cce8ef01b 100755 --- a/tests/test_auto_scan_conv3d.py +++ b/tests/test_auto_scan_conv3d.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -28,7 +30,7 @@ def forward(self, inputs, weight): """ forward """ - x = paddle.nn.functional.conv3d( + return paddle.nn.functional.conv3d( inputs, weight, stride=self.config["stride"], @@ -37,7 +39,6 @@ def forward(self, inputs, weight): groups=self.config["groups"], data_format=self.config["data_format"], ) - return x class TestConv3dConvert(OPConvertAutoScanTest): @@ -129,7 +130,7 @@ def sample_convert_config(self, draw): ), axis=0, ).tolist() - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding3 + padding = [[0, 0], [0, 0], *padding1, *padding2, *padding3] elif padding_type == "list": if draw(st.booleans()): padding = draw( diff --git a/tests/test_auto_scan_cumsum.py b/tests/test_auto_scan_cumsum.py index 8d8214c3e..b2e82a417 100755 --- a/tests/test_auto_scan_cumsum.py +++ b/tests/test_auto_scan_cumsum.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -36,8 +38,7 @@ def forward(self, inputs): ) else: axis = self.config["axis"] - x = paddle.cumsum(inputs, axis=axis, dtype=self.config["dtype"]) - return x + return paddle.cumsum(inputs, axis=axis, dtype=self.config["dtype"]) class TestCumsumConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_dist.py b/tests/test_auto_scan_dist.py index ade64f939..44ed45f55 100644 --- a/tests/test_auto_scan_dist.py +++ b/tests/test_auto_scan_dist.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, x, y): """ forward """ - x = paddle.dist(x, y, p=self.config["p"]) - return x + return paddle.dist(x, y, p=self.config["p"]) class TestDistConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_dot.py b/tests/test_auto_scan_dot.py index db16f6fd8..8f0c0e6de 100644 --- a/tests/test_auto_scan_dot.py +++ b/tests/test_auto_scan_dot.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,8 +29,7 @@ def forward(self, x, y): """ forward """ - x = paddle.dot(x, y) - return x + return paddle.dot(x, y) class TestDotConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_dropout.py b/tests/test_auto_scan_dropout.py index 292c1e101..65c6b1a97 100755 --- a/tests/test_auto_scan_dropout.py +++ b/tests/test_auto_scan_dropout.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -import unittest -import paddle import random +import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -34,10 +36,9 @@ def forward(self, x): else: p = self.config["p"] # when training is true, has diff - x = paddle.nn.functional.dropout( + return paddle.nn.functional.dropout( x, training=False, p=p, axis=self.config["axis"], mode=self.config["mode"] ) - return x class TestDropoutConvert(OPConvertAutoScanTest): @@ -81,7 +82,7 @@ def sample_convert_config(self, draw): "tensor_attr": tensor_attr, } if axis is not None: - if mode in ["upscale_in_train"]: + if mode == "upscale_in_train": config["op_names"] = [""] else: config["op_names"] = ["scale"] diff --git a/tests/test_auto_scan_elementwise_ops.py b/tests/test_auto_scan_elementwise_ops.py index 3134734f9..eb8cd1bfb 100755 --- a/tests/test_auto_scan_elementwise_ops.py +++ b/tests/test_auto_scan_elementwise_ops.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -from onnxbase import randtool import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_only_pir, randtool + import paddle -from onnxbase import _test_only_pir op_api_map = { "elementwise_add": paddle.add, @@ -38,8 +39,7 @@ class Net(BaseNet): def forward(self, inputs1, inputs2): - x = op_api_map[self.config["op_names"]](inputs1, inputs2) - return x + return op_api_map[self.config["op_names"]](inputs1, inputs2) class TestElementwiseopsConvert(OPConvertAutoScanTest): @@ -90,14 +90,14 @@ def generator_data(): "input_spec_shape": [], } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) - for op_name, i in op_api_map.items(): + for op_name in op_api_map: opset_versions.append(opset_version_map[op_name]) config["op_names"] = op_names config["opset_version"] = opset_versions @@ -124,8 +124,7 @@ def test(self): class Net_2(BaseNet): def forward(self, inputs1, inputs2): - x = op_api_map_2[self.config["op_names"]](inputs1, inputs2) - return x + return op_api_map_2[self.config["op_names"]](inputs1, inputs2) class TestElementwiseopsConvert_2(OPConvertAutoScanTest): @@ -171,14 +170,14 @@ def sample_convert_config(self, draw): "input_spec_shape": [], } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map_2.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map_2: config["op_names"] = op_name models.append(Net_2(config)) op_names.append(op_name) - for op_name, i in op_api_map_2.items(): + for op_name in op_api_map_2: opset_versions.append(opset_version_map_2[op_name]) config["op_names"] = op_names config["opset_version"] = opset_versions diff --git a/tests/test_auto_scan_elu.py b/tests/test_auto_scan_elu.py index 0e0c2f604..99f95bcdf 100755 --- a/tests/test_auto_scan_elu.py +++ b/tests/test_auto_scan_elu.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,8 +29,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.elu(inputs, alpha=self.config["alpha"]) - return x + return paddle.nn.functional.elu(inputs, alpha=self.config["alpha"]) class TestEluConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_expand.py b/tests/test_auto_scan_expand.py index dd0635f04..1f987f166 100755 --- a/tests/test_auto_scan_expand.py +++ b/tests/test_auto_scan_expand.py @@ -12,14 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import random +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle -import random +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -35,8 +37,7 @@ def forward(self, inputs): shape = paddle.to_tensor(np.array(shape).astype(self.config["shape_dtype"])) x = paddle.expand(inputs, shape=shape) # TODO there's bug with expand operator - x = paddle.reshape(x, shape=paddle.to_tensor(np.array([-1]).astype("int32"))) - return x + return paddle.reshape(x, shape=paddle.to_tensor(np.array([-1]).astype("int32"))) class TestExpandConvert(OPConvertAutoScanTest): @@ -90,8 +91,7 @@ def forward(self, inputs): # shape = [paddle.to_tensor(2), paddle.to_tensor(np.array(1).astype("int64")), paddle.to_tensor(2), paddle.to_tensor(3), paddle.to_tensor(2), paddle.to_tensor(2)] x = paddle.expand(inputs, shape=shape) # TODO there's bug with expand operator - x = paddle.reshape(x, shape=paddle.to_tensor(np.array([-1]).astype("int32"))) - return x + return paddle.reshape(x, shape=paddle.to_tensor(np.array([-1]).astype("int32"))) class TestExpandConvert1(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_expand_as.py b/tests/test_auto_scan_expand_as.py index 973397998..761946f09 100755 --- a/tests/test_auto_scan_expand_as.py +++ b/tests/test_auto_scan_expand_as.py @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st +import random import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle -import random class Net(BaseNet): diff --git a/tests/test_auto_scan_eye.py b/tests/test_auto_scan_eye.py index 173f74ad4..9fae3d7af 100755 --- a/tests/test_auto_scan_eye.py +++ b/tests/test_auto_scan_eye.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -35,8 +37,7 @@ def forward(self): if self.config["num_columns"] is not None: num_columns = paddle.assign(self.config["num_columns"]) dtype = self.config["dtype"] - x = paddle.eye(num_rows, num_columns=num_columns, dtype=dtype) - return x + return paddle.eye(num_rows, num_columns=num_columns, dtype=dtype) class TestEyeConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_fill_constant.py b/tests/test_auto_scan_fill_constant.py index 39635b6d6..cc818408e 100755 --- a/tests/test_auto_scan_fill_constant.py +++ b/tests/test_auto_scan_fill_constant.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir -import unittest + import paddle @@ -29,8 +31,7 @@ def forward(self): if self.config["is_shape_tensor"]: shape = paddle.to_tensor(shape).astype(self.config["shape_dtype"]) dtype = self.config["dtype"] - x = paddle.full(shape=shape, fill_value=fill_value, dtype=dtype) - return x + return paddle.full(shape=shape, fill_value=fill_value, dtype=dtype) class TestFullConvert(OPConvertAutoScanTest): @@ -50,10 +51,7 @@ def sample_convert_config(self, draw): # todo tensor is not supported is_tensor = False # draw(st.booleans()) is_shape_tensor = draw(st.booleans()) - if is_shape_tensor: - opset_version = [9, 11, 15] - else: - opset_version = [7, 9, 15] + opset_version = [9, 11, 15] if is_shape_tensor else [7, 9, 15] config = { "op_names": ["fill_constant"], @@ -85,8 +83,7 @@ def forward(self): # TODO not supported # shape = [paddle.to_tensor(2), paddle.to_tensor(np.array(1).astype("int64")), 2, 3, 2, 2] dtype = self.config["dtype"] - x = paddle.full(shape=shape, fill_value=fill_value, dtype=dtype) - return x + return paddle.full(shape=shape, fill_value=fill_value, dtype=dtype) class TestFullConvert1(OPConvertAutoScanTest): @@ -105,10 +102,7 @@ def sample_convert_config(self, draw): fill_value = draw(st.integers(min_value=1, max_value=5)) # todo tensor is not supported is_shape_tensor = True # draw(st.booleans()) - if is_shape_tensor: - opset_version = [9, 15] - else: - opset_version = [7, 9, 15] + opset_version = [9, 15] if is_shape_tensor else [7, 9, 15] config = { "op_names": ["fill_constant"], "test_data_shapes": [], @@ -139,8 +133,7 @@ def forward(self): # TODO not supported # shape = [paddle.to_tensor(2), paddle.to_tensor(np.array(1).astype("int64")), 2, 3, 2, 2] dtype = self.config["dtype"] - x = paddle.full(shape=shape, fill_value=fill_value, dtype=dtype) - return x + return paddle.full(shape=shape, fill_value=fill_value, dtype=dtype) class TestFullConvert2(OPConvertAutoScanTest): @@ -160,10 +153,7 @@ def sample_convert_config(self, draw): # todo tensor is not supported is_tensor = draw(st.booleans()) is_shape_tensor = True # draw(st.booleans()) - if is_shape_tensor: - opset_version = [9, 11, 15] - else: - opset_version = [7, 9, 15] + opset_version = [9, 11, 15] if is_shape_tensor else [7, 9, 15] config = { "op_names": ["fill_constant"], "test_data_shapes": [], diff --git a/tests/test_auto_scan_fill_like.py b/tests/test_auto_scan_fill_like.py index 5a6630210..c0e7ae554 100755 --- a/tests/test_auto_scan_fill_like.py +++ b/tests/test_auto_scan_fill_like.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle op_api_map = { @@ -33,8 +35,7 @@ def forward(self, x): forward """ x = op_api_map[self.config["op_names"]](x) - x = x.astype("int32") - return x + return x.astype("int32") class TestFillLikeConvert(OPConvertAutoScanTest): @@ -58,9 +59,9 @@ def sample_convert_config(self, draw): "input_spec_shape": [], } - models = list() - op_names = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) diff --git a/tests/test_auto_scan_flatten.py b/tests/test_auto_scan_flatten.py index 2b69d6bee..9a8a91956 100755 --- a/tests/test_auto_scan_flatten.py +++ b/tests/test_auto_scan_flatten.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,10 +30,9 @@ def forward(self, x): """ forward """ - x = paddle.flatten( + return paddle.flatten( x, start_axis=self.config["start_axis"], stop_axis=self.config["stop_axis"] ) - return x class TestFlattenConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_flip.py b/tests/test_auto_scan_flip.py index 22da09857..3fb7e4601 100755 --- a/tests/test_auto_scan_flip.py +++ b/tests/test_auto_scan_flip.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, x): """ forward """ - x = paddle.flip(x, axis=self.config["axis"]) - return x + return paddle.flip(x, axis=self.config["axis"]) class TestFlattenConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_floordiv.py b/tests/test_auto_scan_floordiv.py index 2bbd12ede..4b6235afd 100755 --- a/tests/test_auto_scan_floordiv.py +++ b/tests/test_auto_scan_floordiv.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -from onnxbase import randtool import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir, randtool + import paddle -from onnxbase import _test_with_pir op_api_map = {"elementwise_floordiv": paddle.floor_divide} @@ -28,8 +29,7 @@ class Net(BaseNet): def forward(self, inputs1, inputs2): - x = op_api_map[self.config["op_names"]](inputs1, inputs2) - return x + return op_api_map[self.config["op_names"]](inputs1, inputs2) class TestfloordivConvert(OPConvertAutoScanTest): @@ -68,8 +68,7 @@ def sample_convert_config(self, draw): dtype = draw(st.sampled_from(["int32", "int64"])) def generator_data(): - input_data = randtool("int", 1.0, 20.0, input2_shape) - return input_data + return randtool("int", 1.0, 20.0, input2_shape) config = { "op_names": ["elementwise_floordiv"], @@ -79,14 +78,14 @@ def generator_data(): "input_spec_shape": [], } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) - for op_name, i in op_api_map.items(): + for op_name in op_api_map: opset_versions.append(opset_version_map[op_name]) config["op_names"] = op_names config["opset_version"] = opset_versions diff --git a/tests/test_auto_scan_full_like.py b/tests/test_auto_scan_full_like.py index 3af481ac0..3edc08c65 100755 --- a/tests/test_auto_scan_full_like.py +++ b/tests/test_auto_scan_full_like.py @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_only_pir, randtool + import paddle -from onnxbase import randtool, _test_only_pir op_api_map = { "fill_any_like": paddle.ones_like, @@ -34,8 +36,7 @@ def forward(self, x): forward """ x = op_api_map[self.config["op_names"]](x) - x = x.astype("int32") - return x + return x.astype("int32") class TestFullLikeConvert(OPConvertAutoScanTest): @@ -59,9 +60,9 @@ def sample_convert_config(self, draw): "input_spec_shape": [], } - models = list() - op_names = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) @@ -84,8 +85,7 @@ def forward(self, x, fill_value): forward """ x = paddle.full_like(x, fill_value) - x = x.astype("int32") - return x + return x.astype("int32") class TestFullLikeConvert2(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_gather.py b/tests/test_auto_scan_gather.py index e1274eb69..273d01cc1 100644 --- a/tests/test_auto_scan_gather.py +++ b/tests/test_auto_scan_gather.py @@ -12,14 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -import numpy as np import unittest -import paddle from random import sample + +import hypothesis.strategies as st +import numpy as np +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net0(BaseNet): """ @@ -30,8 +32,7 @@ def forward(self, x, index): """ forward """ - x = paddle.gather(x, index, axis=self.config["axis"]) - return x + return paddle.gather(x, index, axis=self.config["axis"]) class Net1(BaseNet): @@ -47,8 +48,7 @@ def forward(self, x, index): axis = paddle.to_tensor(axis, dtype="int64") x = paddle.gather(x, index, axis=axis) shape = paddle.shape(x) - x = paddle.reshape(x, shape) - return x + return paddle.reshape(x, shape) class TestGatherConvert0(OPConvertAutoScanTest): @@ -68,7 +68,7 @@ def sample_convert_config(self, draw): axis = draw(st.integers(min_value=0, max_value=len(input_shape) - 1)) def generator_index(): - index_list = [i for i in range(input_shape[axis])] + index_list = list(range(input_shape[axis])) index_select = sample(index_list, 2) return np.array(index_select) @@ -107,7 +107,7 @@ def sample_convert_config(self, draw): axis = draw(st.integers(min_value=0, max_value=len(input_shape) - 1)) def generator_index(): - index_list = [i for i in range(input_shape[axis])] + index_list = list(range(input_shape[axis])) index_select = sample(index_list, 2) return np.array(index_select) diff --git a/tests/test_auto_scan_gather_nd.py b/tests/test_auto_scan_gather_nd.py index a71535e6b..af1ab039f 100755 --- a/tests/test_auto_scan_gather_nd.py +++ b/tests/test_auto_scan_gather_nd.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -from onnxbase import randtool -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir, randtool + import paddle -from onnxbase import _test_with_pir class Net(BaseNet): @@ -29,8 +30,7 @@ def forward(self, input1, input2): """ forward """ - x = paddle.gather_nd(input1, input2) - return x + return paddle.gather_nd(input1, input2) class TestGatherNDConvert(OPConvertAutoScanTest): @@ -60,8 +60,7 @@ def sample_convert_config(self, draw): input2_shape = [len(input_shape)] def generator_data(): - input_data = randtool("int", 0, 10, input2_shape) - return input_data + return randtool("int", 0, 10, input2_shape) config = { "op_names": ["gather_nd"], diff --git a/tests/test_auto_scan_gaussian_random.py b/tests/test_auto_scan_gaussian_random.py index 66e6f4cae..9add10912 100755 --- a/tests/test_auto_scan_gaussian_random.py +++ b/tests/test_auto_scan_gaussian_random.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -from onnxbase import randtool, _test_with_pir -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir, randtool + import paddle @@ -29,13 +31,12 @@ def forward(self, input_1, input_2, input_3): forward """ inputs = [input_1, input_2, input_3] - x = paddle.tensor.random.gaussian( + return paddle.tensor.random.gaussian( inputs, mean=self.config["mean"], std=self.config["std"], dtype=self.config["out_dtype"], ) - return x class TestGaussianRandomConvert_tensorlist(OPConvertAutoScanTest): @@ -56,16 +57,13 @@ def sample_convert_config(self, draw): out_dtype = draw(st.sampled_from(["float32", "float64"])) def generator1_data(): - input_data1 = randtool("int", 1, 10, input_shape[0]) - return input_data1 + return randtool("int", 1, 10, input_shape[0]) def generator2_data(): - input_data2 = randtool("int", 1, 10, input_shape[1]) - return input_data2 + return randtool("int", 1, 10, input_shape[1]) def generator3_data(): - input_data3 = randtool("int", 1, 10, input_shape[2]) - return input_data3 + return randtool("int", 1, 10, input_shape[2]) dtype = draw(st.sampled_from(["int32", "int64"])) @@ -101,13 +99,12 @@ def forward(self, inputs): """ forward """ - x = paddle.tensor.random.gaussian( + return paddle.tensor.random.gaussian( inputs, mean=self.config["mean"], std=self.config["std"], dtype=self.config["out_dtype"], ) - return x class TestGaussianRandomConvert(OPConvertAutoScanTest): @@ -128,8 +125,7 @@ def sample_convert_config(self, draw): out_dtype = draw(st.sampled_from(["float32", "float64"])) def generator_data(): - input_data = randtool("int", 1, 10, input_shape) - return input_data + return randtool("int", 1, 10, input_shape) dtype = draw(st.sampled_from(["int32", "int64"])) @@ -165,13 +161,12 @@ def forward(self): """ forward """ - x = paddle.tensor.random.gaussian( + return paddle.tensor.random.gaussian( shape=self.config["shape"], mean=self.config["mean"], std=self.config["std"], dtype=self.config["out_dtype"], ) - return x class TestGaussianRandomConvert_list(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_gelu.py b/tests/test_auto_scan_gelu.py index a2bd11e8a..dd9bcb2d5 100644 --- a/tests/test_auto_scan_gelu.py +++ b/tests/test_auto_scan_gelu.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.gelu(inputs, approximate=False) - return x + return paddle.nn.functional.gelu(inputs, approximate=False) class TestGeluConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_grid_sampler.py b/tests/test_auto_scan_grid_sampler.py index 5fafcf3bb..f51d4a5d1 100755 --- a/tests/test_auto_scan_grid_sampler.py +++ b/tests/test_auto_scan_grid_sampler.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir @@ -28,19 +29,18 @@ def forward(self, x, grid): """ forward """ - out = paddle.nn.functional.grid_sample( + return paddle.nn.functional.grid_sample( x, grid, align_corners=self.config["align_corners"], padding_mode=self.config["padding_mode"], mode=self.config["mode"], ) - return out class TestGroupNormConvert(OPConvertAutoScanTest): """ - api: paddle.fluid.layers.nn.group_norm + api: paddle.nn.functional.grid_sample OPset version: 7, 9, 15 """ diff --git a/tests/test_auto_scan_group_norm.py b/tests/test_auto_scan_group_norm.py index 7501431ff..d23d322cb 100755 --- a/tests/test_auto_scan_group_norm.py +++ b/tests/test_auto_scan_group_norm.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir @@ -25,7 +26,7 @@ class Net(BaseNet): """ def __init__(self, config=None): - super(Net, self).__init__(config) + super().__init__(config) groups = self.config["groups"] epsilon = self.config["epsilon"] num_channels = self.config["num_channels"] @@ -43,13 +44,12 @@ def forward(self, inputs): """ forward """ - x = self.group_norm(inputs) - return x + return self.group_norm(inputs) class TestGroupNormConvert(OPConvertAutoScanTest): """ - api: paddle.fluid.layers.nn.group_norm + api: paddle.nn.GroupNorm OPset version: 7, 9, 15 """ diff --git a/tests/test_auto_scan_hardsigmoid.py b/tests/test_auto_scan_hardsigmoid.py index d7afa3981..cfaa836c8 100644 --- a/tests/test_auto_scan_hardsigmoid.py +++ b/tests/test_auto_scan_hardsigmoid.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,10 +30,9 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.hardsigmoid( + return paddle.nn.functional.hardsigmoid( inputs, slope=self.config["slope"], offset=self.config["offset"] ) - return x class TestHardsigmoidConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_hardswish.py b/tests/test_auto_scan_hardswish.py index dcc55c57a..f69c2e222 100644 --- a/tests/test_auto_scan_hardswish.py +++ b/tests/test_auto_scan_hardswish.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.hardswish(inputs) - return x + return paddle.nn.functional.hardswish(inputs) class TestHardswishConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_index_put.py b/tests/test_auto_scan_index_put.py index 00a459d79..0c20cf21f 100644 --- a/tests/test_auto_scan_index_put.py +++ b/tests/test_auto_scan_index_put.py @@ -13,13 +13,14 @@ # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st import numpy as np -from onnxbase import randtool -from onnxbase import _test_with_pir +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir, randtool + +import paddle class Net(BaseNet): @@ -30,10 +31,9 @@ class Net(BaseNet): def forward(self, inputs, indices, value): accumulate = self.config.get("accumulate", False) indices = list(indices) # index_put() expects a list/tuple of tensors - x = paddle.index_put( + return paddle.index_put( inputs, indices=indices, value=value, accumulate=accumulate ) - return x class TestIndexPutConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_index_sample.py b/tests/test_auto_scan_index_sample.py index 55c30969b..2d0e35177 100755 --- a/tests/test_auto_scan_index_sample.py +++ b/tests/test_auto_scan_index_sample.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import randtool +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, input, index): """ forward """ - x = paddle.index_sample(input, index=index) - return x + return paddle.index_sample(input, index=index) class TestIndexSampleConvert(OPConvertAutoScanTest): @@ -51,8 +52,7 @@ def generator_data(): import random n = random.randint(1, input_shape[1]) - input_data = randtool("int", 0.0, input_shape[1] - 1, [input_shape[0], n]) - return input_data + return randtool("int", 0.0, input_shape[1] - 1, [input_shape[0], n]) config = { "op_names": ["index_sample"], diff --git a/tests/test_auto_scan_index_select.py b/tests/test_auto_scan_index_select.py index 9c481e89e..24264d6f3 100644 --- a/tests/test_auto_scan_index_select.py +++ b/tests/test_auto_scan_index_select.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir, randtool + import paddle -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(BaseNet): @@ -29,8 +30,7 @@ def forward(self, input, index): """ forward """ - x = paddle.index_select(input, index=index, axis=self.config["axis"]) - return x + return paddle.index_select(input, index=index, axis=self.config["axis"]) class TestIndexselectConvert(OPConvertAutoScanTest): @@ -53,8 +53,7 @@ def generator_data(): n = random.randint(1, len(input_shape)) min_val = min(input_shape) - input_data = randtool("int", 0.0, min_val - 1, n) - return input_data + return randtool("int", 0.0, min_val - 1, n) config = { "op_names": ["index_select"], diff --git a/tests/test_auto_scan_instance_norm.py b/tests/test_auto_scan_instance_norm.py index b6a6da803..84a07f6d0 100755 --- a/tests/test_auto_scan_instance_norm.py +++ b/tests/test_auto_scan_instance_norm.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir + import paddle from paddle import ParamAttr -from onnxbase import _test_with_pir class Net(BaseNet): @@ -26,7 +28,7 @@ class Net(BaseNet): """ def __init__(self, config=None): - super(Net, self).__init__(config) + super().__init__(config) param_shape = [self.config["input_shape"][1]] dtype = self.config["dtype"] @@ -62,7 +64,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.instance_norm( + return paddle.nn.functional.instance_norm( inputs, running_mean=self.mean, running_var=self.variance, @@ -73,7 +75,6 @@ def forward(self, inputs): eps=self.config["epsilon"], data_format=self.config["data_format"], ) - return x class TestInstanceNormConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_interpolate_ops.py b/tests/test_auto_scan_interpolate_ops.py index a1c0493fb..08cf964b2 100755 --- a/tests/test_auto_scan_interpolate_ops.py +++ b/tests/test_auto_scan_interpolate_ops.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + op_api_map = { "linear": "linear_interp_v2", "bilinear": "bilinear_interp_v2", @@ -69,7 +71,7 @@ def forward(self, inputs): # align_corners True is only set with the interpolating modes: linear | bilinear | bicubic | trilinear if mode == "nearest": align_corners = False - x = paddle.nn.functional.interpolate( + return paddle.nn.functional.interpolate( x=inputs, size=size, scale_factor=scale_factor, @@ -78,7 +80,6 @@ def forward(self, inputs): align_mode=align_mode, data_format=data_format, ) - return x class TestInterpolateConvert(OPConvertAutoScanTest): @@ -204,7 +205,7 @@ def forward(self, inputs): # align_corners True is only set with the interpolating modes: linear | bilinear | bicubic | trilinear if mode == "nearest": align_corners = False - x = paddle.nn.functional.interpolate( + return paddle.nn.functional.interpolate( x=inputs, size=size, scale_factor=scale_factor, @@ -213,7 +214,6 @@ def forward(self, inputs): align_mode=align_mode, data_format=data_format, ) - return x class TestInterpolateConvert1(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_isx_ops.py b/tests/test_auto_scan_isx_ops.py index ed8f89fe4..65ebb2491 100644 --- a/tests/test_auto_scan_isx_ops.py +++ b/tests/test_auto_scan_isx_ops.py @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st -from onnxbase import _test_with_pir import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir + import paddle op_api_map = { @@ -75,8 +77,7 @@ def generator_data(): minus_nan_data = np.ones(shape=input_shape) minus_nan_data[:] = float("-nan") minus_nan_condition = np.random.randint(-2, 2, input_shape).astype("bool") - input_data = np.where(minus_nan_condition, input_data, minus_nan_data) - return input_data + return np.where(minus_nan_condition, input_data, minus_nan_data) config = { "op_names": ["isX"], @@ -86,10 +87,10 @@ def generator_data(): "input_spec_shape": [], } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) diff --git a/tests/test_auto_scan_layer_norm.py b/tests/test_auto_scan_layer_norm.py index 59f5e12cb..66532d6f1 100755 --- a/tests/test_auto_scan_layer_norm.py +++ b/tests/test_auto_scan_layer_norm.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -26,7 +28,7 @@ class Net(BaseNet): """ def __init__(self, config=None): - super(Net, self).__init__(config) + super().__init__(config) param_shape = [np.prod(self.config["normalized_shape"])] self.weight = self.create_parameter( attr=None, @@ -40,14 +42,13 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.layer_norm( + return paddle.nn.functional.layer_norm( inputs, weight=self.weight if self.config["has_weight_bias"] else None, bias=self.bias if self.config["has_weight_bias"] else None, normalized_shape=self.config["normalized_shape"], epsilon=self.config["epsilon"], ) - return x class TestLayerNormConvert(OPConvertAutoScanTest): @@ -60,7 +61,7 @@ def sample_convert_config(self, draw): input_shape = draw( st.lists(st.integers(min_value=2, max_value=8), min_size=2, max_size=5) ) - input_spec = [-1] * len(input_shape) + [-1] * len(input_shape) # When the dims is 5 and the last dimension is too small, an error will be reported due to the optimization of ONNXRuntime if len(input_shape) == 5: @@ -68,10 +69,7 @@ def sample_convert_config(self, draw): axis = draw(st.integers(min_value=1, max_value=len(input_shape) - 1)) axis_type = draw(st.sampled_from(["int", "list"])) - if axis_type == "int": - normalized_shape = input_shape[-1] - else: - normalized_shape = input_shape[axis:] + normalized_shape = input_shape[-1] if axis_type == "int" else input_shape[axis:] dtype = draw(st.sampled_from(["float32"])) epsilon = draw(st.floats(min_value=1e-12, max_value=1e-5)) diff --git a/tests/test_auto_scan_leakyrelu.py b/tests/test_auto_scan_leakyrelu.py index 6375debd0..cf9100338 100644 --- a/tests/test_auto_scan_leakyrelu.py +++ b/tests/test_auto_scan_leakyrelu.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,10 +30,9 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.leaky_relu( + return paddle.nn.functional.leaky_relu( inputs, negative_slope=self.config["negative_slope"] ) - return x class TestLeakyreluConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_linspace.py b/tests/test_auto_scan_linspace.py index bfbc26a54..2ee446763 100755 --- a/tests/test_auto_scan_linspace.py +++ b/tests/test_auto_scan_linspace.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): def forward(self): @@ -25,8 +27,7 @@ def forward(self): stop = self.config["stop"] num = self.config["num"] dtype = self.config["dtype"] - x = paddle.linspace(start=start, stop=stop, num=num, dtype=dtype) - return x + return paddle.linspace(start=start, stop=stop, num=num, dtype=dtype) class TestLinspaceConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_log.py b/tests/test_auto_scan_log.py index 5bc7315b4..f5aa7533d 100755 --- a/tests/test_auto_scan_log.py +++ b/tests/test_auto_scan_log.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + op_api_map = {"log1p": paddle.log1p, "log10": paddle.log10} @@ -47,9 +49,9 @@ def sample_convert_config(self, draw): "input_spec_shape": [], } - models = list() - op_names = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) diff --git a/tests/test_auto_scan_logical_ops.py b/tests/test_auto_scan_logical_ops.py index d5b2589cb..877e58f7d 100755 --- a/tests/test_auto_scan_logical_ops.py +++ b/tests/test_auto_scan_logical_ops.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle op_api_map = { @@ -54,8 +56,7 @@ def forward(self, inputs1, inputs2): ): inputs1 = inputs1.astype("int32") inputs2 = inputs2.astype("int32") - x = op_api_map[self.config["op_names"]](inputs1, inputs2) - return x + return op_api_map[self.config["op_names"]](inputs1, inputs2) class TestLogicopsConvert(OPConvertAutoScanTest): @@ -104,10 +105,10 @@ def sample_convert_config(self, draw): "input_spec_shape": [], } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) diff --git a/tests/test_auto_scan_logsigmoid.py b/tests/test_auto_scan_logsigmoid.py index 253e319d4..6877f6a75 100755 --- a/tests/test_auto_scan_logsigmoid.py +++ b/tests/test_auto_scan_logsigmoid.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,8 +29,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.log_sigmoid(inputs) - return x + return paddle.nn.functional.log_sigmoid(inputs) class TestLogsigmoidConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_logsoftmax.py b/tests/test_auto_scan_logsoftmax.py index 37a0a7397..9ecaffe79 100755 --- a/tests/test_auto_scan_logsoftmax.py +++ b/tests/test_auto_scan_logsoftmax.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,8 +29,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.log_softmax(inputs, axis=self.config["axis"]) - return x + return paddle.nn.functional.log_softmax(inputs, axis=self.config["axis"]) class TestLogSoftmaxConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_logsumexp.py b/tests/test_auto_scan_logsumexp.py index 45f104b7b..922128791 100644 --- a/tests/test_auto_scan_logsumexp.py +++ b/tests/test_auto_scan_logsumexp.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,10 +29,9 @@ def forward(self, inputs): """ forward """ - x = paddle.logsumexp( + return paddle.logsumexp( inputs, axis=self.config["axis"], keepdim=self.config["keepdim"] ) - return x class TestLogsumexpConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_lookup_table_v2.py b/tests/test_auto_scan_lookup_table_v2.py index ab3b276d9..4a6ea66a7 100755 --- a/tests/test_auto_scan_lookup_table_v2.py +++ b/tests/test_auto_scan_lookup_table_v2.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -from onnxbase import randtool -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import randtool + import paddle @@ -28,13 +30,12 @@ def forward(self, inputs, weight): """ forward """ - x = paddle.nn.functional.embedding( + return paddle.nn.functional.embedding( inputs, weight, padding_idx=self.config["padding_idx"], sparse=self.config["sparse"], ) - return x class TestKookuptablev2Convert(OPConvertAutoScanTest): @@ -53,8 +54,7 @@ def sample_convert_config(self, draw): ) def generator_data(): - input_data = randtool("int", 0, weight_shape[0] - 1, input_shape) - return input_data + return randtool("int", 0, weight_shape[0] - 1, input_shape) padding_idx = None if draw(st.booleans()): diff --git a/tests/test_auto_scan_masked_select.py b/tests/test_auto_scan_masked_select.py index 26e573700..08856b9e0 100644 --- a/tests/test_auto_scan_masked_select.py +++ b/tests/test_auto_scan_masked_select.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, x, y): """ forward """ - x = paddle.masked_select(x, y) - return x + return paddle.masked_select(x, y) class TestMaskedselectConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_matmul.py b/tests/test_auto_scan_matmul.py index 56de84e51..2d9290f52 100755 --- a/tests/test_auto_scan_matmul.py +++ b/tests/test_auto_scan_matmul.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,13 +30,12 @@ def forward(self, x, y): """ forward """ - x = paddle.matmul( + return paddle.matmul( x, y, transpose_x=self.config["transpose_x"], transpose_y=self.config["transpose_y"], ) - return x class TestMatmulConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_meshgrid.py b/tests/test_auto_scan_meshgrid.py index 4b24dab1a..a32565532 100644 --- a/tests/test_auto_scan_meshgrid.py +++ b/tests/test_auto_scan_meshgrid.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs1, inputs2): """ forward """ - x = paddle.meshgrid([inputs1, inputs2]) - return x + return paddle.meshgrid([inputs1, inputs2]) class TestMeshgridConvert(OPConvertAutoScanTest): @@ -75,8 +76,7 @@ def forward(self, inputs1, inputs2, inputs3): """ forward """ - x = paddle.meshgrid([inputs1, inputs2, inputs3]) - return x + return paddle.meshgrid([inputs1, inputs2, inputs3]) class TestMeshgridConvert1(OPConvertAutoScanTest): @@ -126,8 +126,7 @@ def forward(self, inputs1, inputs2, inputs3, inputs4, inputs5): """ forward """ - x = paddle.meshgrid([inputs1, inputs2, inputs3, inputs4, inputs5]) - return x + return paddle.meshgrid([inputs1, inputs2, inputs3, inputs4, inputs5]) class TestMeshgridConvert2(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_mish.py b/tests/test_auto_scan_mish.py index 311f501ba..275292446 100755 --- a/tests/test_auto_scan_mish.py +++ b/tests/test_auto_scan_mish.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import randtool -import unittest + import paddle @@ -28,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.mish(inputs) - return x + return paddle.nn.functional.mish(inputs) class TestMishConvert(OPConvertAutoScanTest): @@ -44,8 +45,7 @@ def sample_convert_config(self, draw): ) def generator_data(): - input_data = randtool("float", -100, 100, input_shape) - return input_data + return randtool("float", -100, 100, input_shape) dtype = draw(st.sampled_from(["float32", "float64"])) diff --git a/tests/test_auto_scan_multiclass_nms.py b/tests/test_auto_scan_multiclass_nms.py index 07241963a..06a0b8594 100755 --- a/tests/test_auto_scan_multiclass_nms.py +++ b/tests/test_auto_scan_multiclass_nms.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from multiprocessing import Process -from multiprocessing import Queue +from multiprocessing import Process, Queue + import numpy as np from detection_ops.nms import multiclass_nms @@ -51,7 +51,7 @@ def __init__( return_index, return_rois_num, ): - super(Model, self).__init__() + super().__init__() self.score_threshold = score_threshold self.nms_top_k = nms_top_k self.keep_top_k = keep_top_k @@ -135,7 +135,7 @@ def gen_onnx_export(q): for opset in range(10, 16): import paddle2onnx - onnx_file_path = "nms/nms_{}.onnx".format(opset) + onnx_file_path = f"nms/nms_{opset}.onnx" paddle2onnx.export( "nms/model.pdmodel", "", @@ -150,39 +150,39 @@ def gen_onnx_export(q): sess = ort.InferenceSession(onnx_file_path) result1 = sess.run(None, {"x0": data[0], "x1": data[1]}) - assert len(result0) == len( - result1 - ), "multiclass_nms3: Length of result is not same" + assert len(result0) == len(result1), ( + "multiclass_nms3: Length of result is not same" + ) diff = np.fabs(all_sort(result0[0]) - all_sort(result1[0])) print("Max diff of BBoxes:", result0[0].shape, result1[0].shape, diff.max()) - assert diff.max() < 1e-05, "Difference={} of bbox is exceed 1e-05".format( - diff.max() - ) + assert diff.max() < 1e-05, f"Difference={diff.max()} of bbox is exceed 1e-05" for i in range(1, len(result0)): diff = np.fabs(result0[i] - result1[i]) print(result0[i], result1[i]) - assert ( - diff.max() < 1e-05 - ), "Difference={} of output {}(shape is {}) is exceed 1e-05".format( - diff.max(), i, result0[i].shape + assert diff.max() < 1e-05, ( + f"Difference={diff.max()} of output {i}(shape is {result0[i].shape}) is exceed 1e-05" ) q.put(True) def test_nms(): - for i in range(100): + for _i in range(100): q0 = Queue() p0 = Process(target=gen_paddle_nms, args=(q0,)) p0.start() p0.join() if not q0.get(timeout=1): - assert False, "Test failed for multiclass_nms as gen paddle model step." + raise AssertionError( + "Test failed for multiclass_nms as gen paddle model step." + ) q1 = Queue() p1 = Process(target=gen_onnx_export, args=(q1,)) p1.start() p1.join() if not q1.get(timeout=1): - assert False, "Test failed for multiclass_nms at gen_onnx_export step." + raise AssertionError( + "Test failed for multiclass_nms at gen_onnx_export step." + ) if __name__ == "__main__": diff --git a/tests/test_auto_scan_mv.py b/tests/test_auto_scan_mv.py index 73f537b7c..51d6baf1d 100644 --- a/tests/test_auto_scan_mv.py +++ b/tests/test_auto_scan_mv.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,8 +29,7 @@ def forward(self, x, y): """ forward """ - x = paddle.mv(x, y) - return x + return paddle.mv(x, y) class TestMvConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_norm.py b/tests/test_auto_scan_norm.py index be00faf78..bb1454a11 100755 --- a/tests/test_auto_scan_norm.py +++ b/tests/test_auto_scan_norm.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,10 +29,9 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.normalize( + return paddle.nn.functional.normalize( inputs, axis=self.config["axis"], epsilon=self.config["epsilon"] ) - return x class TestNormConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_one_hot_v2.py b/tests/test_auto_scan_one_hot_v2.py index 4079f5509..cb8c26825 100755 --- a/tests/test_auto_scan_one_hot_v2.py +++ b/tests/test_auto_scan_one_hot_v2.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -from onnxbase import randtool + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_only_pir, randtool + import paddle -from onnxbase import _test_only_pir class Net(BaseNet): @@ -32,8 +33,7 @@ def forward(self, inputs): num_classes = self.config["num_classes"] if self.config["is_tensor"]: num_classes = paddle.to_tensor([num_classes]) - x = paddle.nn.functional.one_hot(inputs, num_classes) - return x + return paddle.nn.functional.one_hot(inputs, num_classes) class TestOneHotV2Convert(OPConvertAutoScanTest): @@ -50,8 +50,7 @@ def sample_convert_config(self, draw): num_classes = draw(st.integers(min_value=10, max_value=20)) def generator_data(): - input_data = randtool("int", 0, num_classes - 1, input_shape) - return input_data + return randtool("int", 0, num_classes - 1, input_shape) dtype = draw(st.sampled_from(["int32", "int64"])) diff --git a/tests/test_auto_scan_p_norm.py b/tests/test_auto_scan_p_norm.py index 1863b1ac4..92b1bea23 100755 --- a/tests/test_auto_scan_p_norm.py +++ b/tests/test_auto_scan_p_norm.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,13 +30,12 @@ def forward(self, inputs): """ forward """ - x = paddle.norm( + return paddle.norm( inputs, p=self.config["p"], axis=self.config["axis"], keepdim=self.config["keepdim"], ) - return x class TestPnormConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_pad.py b/tests/test_auto_scan_pad.py index c15089227..6ae06c6c9 100755 --- a/tests/test_auto_scan_pad.py +++ b/tests/test_auto_scan_pad.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -24,10 +26,9 @@ def forward(self, inputs): mode = self.config["mode"] value = self.config["value"] data_format = self.config["data_format"] - x = paddle.nn.functional.pad( + return paddle.nn.functional.pad( inputs, pad=pad, mode=mode, value=value, data_format=data_format ) - return x class TestPadopsConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_pad2d.py b/tests/test_auto_scan_pad2d.py index ce7f567bd..8416604b2 100755 --- a/tests/test_auto_scan_pad2d.py +++ b/tests/test_auto_scan_pad2d.py @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st -from onnxbase import randtool, _test_with_pir import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir, randtool + import paddle @@ -26,10 +28,9 @@ def forward(self, inputs): mode = self.config["mode"] pad_value = self.config["pad_value"] data_format = self.config["data_format"] - x = paddle.nn.functional.pad( + return paddle.nn.functional.pad( inputs, pad=paddings, mode=mode, value=pad_value, data_format=data_format ) - return x class TestPadopsConvert(OPConvertAutoScanTest): @@ -83,10 +84,9 @@ def forward(self, inputs, padding): mode = self.config["mode"] pad_value = self.config["pad_value"] data_format = self.config["data_format"] - x = paddle.nn.functional.pad( + return paddle.nn.functional.pad( inputs, pad=padding, mode=mode, value=pad_value, data_format=data_format ) - return x class TestPadopsConvert_Paddingtensor(OPConvertAutoScanTest): @@ -111,8 +111,7 @@ def sample_convert_config(self, draw): data_format = draw(st.sampled_from(["NCHW", "NHWC"])) def generator_data(): - input_data = randtool("int", 1, 10, paddings) - return input_data + return randtool("int", 1, 10, paddings) config = { "op_names": ["pad2d"], @@ -144,10 +143,9 @@ def forward(self, inputs): mode = self.config["mode"] pad_value = self.config["pad_value"] data_format = self.config["data_format"] - x = paddle.nn.functional.pad( + return paddle.nn.functional.pad( inputs, pad=padding, mode=mode, value=pad_value, data_format=data_format ) - return x class TestPadopsConvert_Constanttensor(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_pad3d.py b/tests/test_auto_scan_pad3d.py index c19fff784..3756ae420 100755 --- a/tests/test_auto_scan_pad3d.py +++ b/tests/test_auto_scan_pad3d.py @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st -from onnxbase import _test_with_pir import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import _test_with_pir + import paddle @@ -30,9 +32,7 @@ def forward(self, inputs): inputs, pad=pad, mode=mode, value=value, data_format=data_format ) shape = paddle.shape(x) - x = paddle.reshape(x, shape) - - return x + return paddle.reshape(x, shape) class TestPadopsConvert(OPConvertAutoScanTest): @@ -108,9 +108,7 @@ def forward(self, inputs): inputs, pad, mode=mode, value=value, data_format=data_format ) shape = paddle.shape(x) - x = paddle.reshape(x, shape) - - return x + return paddle.reshape(x, shape) class TestPadopsConvert_Constanttensor(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_partial_ops.py b/tests/test_auto_scan_partial_ops.py index 0c1483fb2..e04f68c8e 100755 --- a/tests/test_auto_scan_partial_ops.py +++ b/tests/test_auto_scan_partial_ops.py @@ -12,14 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -from paddle.incubate.layers import partial_sum, partial_concat -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + +try: + from paddle.incubate.layers import partial_concat, partial_sum + + _HAS_PARTIAL_OPS = True +except ImportError: + _HAS_PARTIAL_OPS = False + name2fun_dict = {} -name2fun_dict["partial_sum"] = partial_sum -name2fun_dict["partial_concat"] = partial_concat +if _HAS_PARTIAL_OPS: + name2fun_dict["partial_sum"] = partial_sum + name2fun_dict["partial_concat"] = partial_concat class Net(BaseNet): @@ -32,19 +40,22 @@ def forward(self, inputs1, inputs2): forward """ inputs_list = [inputs1] - for i in range(self.config["repeat_times"]): + for _i in range(self.config["repeat_times"]): inputs_list.append(inputs2) - x = name2fun_dict[self.config["op_names"][0]]( + return name2fun_dict[self.config["op_names"][0]]( inputs_list, start_index=self.config["start_index"], length=self.config["length"], ) - return x +@unittest.skipUnless( + _HAS_PARTIAL_OPS, + "Requires paddle.incubate.layers.partial_concat/partial_sum, removed in PaddlePaddle 3.x", +) class TestConcatConvert(OPConvertAutoScanTest): """ - api: paddle.fluid.contrib.layers.partial_* + api: paddle.incubate.layers.partial_concat / partial_sum OPset version: 7, 9, 15 """ diff --git a/tests/test_auto_scan_pixel_shuffle.py b/tests/test_auto_scan_pixel_shuffle.py index 423660c6f..683b8c0fe 100644 --- a/tests/test_auto_scan_pixel_shuffle.py +++ b/tests/test_auto_scan_pixel_shuffle.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,12 +29,10 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.pixel_shuffle( + return paddle.nn.functional.pixel_shuffle( inputs, upscale_factor=self.config["upscale_factor"] ) - return x - class TestPixelshuffleConvert(OPConvertAutoScanTest): """ diff --git a/tests/test_auto_scan_pool_adaptive_avg_ops.py b/tests/test_auto_scan_pool_adaptive_avg_ops.py index ddc91c7c2..68d3d4e76 100755 --- a/tests/test_auto_scan_pool_adaptive_avg_ops.py +++ b/tests/test_auto_scan_pool_adaptive_avg_ops.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -28,8 +30,7 @@ def forward(self, inputs): forward """ output_size = self.config["output_size"] - x = paddle.nn.functional.adaptive_avg_pool1d(inputs, output_size=output_size) - return x + return paddle.nn.functional.adaptive_avg_pool1d(inputs, output_size=output_size) class TestAdaptiveAvgPool1dConvert(OPConvertAutoScanTest): @@ -81,10 +82,9 @@ def forward(self, inputs): else: output_size = self.config["output_size"] data_format = self.config["data_format"] - x = paddle.nn.functional.adaptive_avg_pool2d( + return paddle.nn.functional.adaptive_avg_pool2d( inputs, output_size=output_size, data_format=data_format ) - return x class TestAdaptiveAvgPool2dConvert(OPConvertAutoScanTest): @@ -145,10 +145,9 @@ def forward(self, inputs): """ output_size = self.config["output_size"] data_format = self.config["data_format"] - x = paddle.nn.functional.adaptive_avg_pool3d( + return paddle.nn.functional.adaptive_avg_pool3d( inputs, output_size=output_size, data_format=data_format ) - return x class TestAdaptiveAvgPool3dConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_pool_adaptive_max_ops.py b/tests/test_auto_scan_pool_adaptive_max_ops.py index f00d721d7..489c3a715 100644 --- a/tests/test_auto_scan_pool_adaptive_max_ops.py +++ b/tests/test_auto_scan_pool_adaptive_max_ops.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class NetAvgPool1d(BaseNet): """ @@ -29,10 +31,9 @@ def forward(self, inputs): forward """ output_size = self.config["output_size"] - x = paddle.nn.functional.adaptive_max_pool1d( + return paddle.nn.functional.adaptive_max_pool1d( inputs, output_size=output_size, return_mask=False ) - return x class TestAdaptiveAvgPool1dConvert(OPConvertAutoScanTest): @@ -82,10 +83,9 @@ def forward(self, inputs): forward """ output_size = self.config["output_size"] - x = paddle.nn.functional.adaptive_max_pool2d( + return paddle.nn.functional.adaptive_max_pool2d( inputs, output_size, return_mask=False ) - return x class TestAdaptiveAvgPool2dConvert(OPConvertAutoScanTest): @@ -144,10 +144,9 @@ def forward(self, inputs): forward """ output_size = self.config["output_size"] - x = paddle.nn.functional.adaptive_max_pool3d( + return paddle.nn.functional.adaptive_max_pool3d( inputs, output_size=output_size, return_mask=False ) - return x class TestAdaptiveAvgPool3dConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_pool_avg_ops.py b/tests/test_auto_scan_pool_avg_ops.py index b84c20e0e..d74794498 100755 --- a/tests/test_auto_scan_pool_avg_ops.py +++ b/tests/test_auto_scan_pool_avg_ops.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -32,7 +34,7 @@ def forward(self, inputs): stride = self.config["stride"] padding = self.config["padding"] ceil_mode = self.config["ceil_mode"] - x = paddle.nn.functional.avg_pool1d( + return paddle.nn.functional.avg_pool1d( inputs, kernel_size, stride=stride, @@ -40,7 +42,6 @@ def forward(self, inputs): exclusive=True, ceil_mode=ceil_mode, ) - return x class TestAvgpool1dConvert(OPConvertAutoScanTest): @@ -122,7 +123,7 @@ def forward(self, inputs): padding = self.config["padding"] ceil_mode = self.config["ceil_mode"] data_format = self.config["data_format"] - x = paddle.nn.functional.avg_pool2d( + return paddle.nn.functional.avg_pool2d( inputs, kernel_size, stride=stride, @@ -133,8 +134,6 @@ def forward(self, inputs): data_format=data_format, ) - return x - class TestAvgpool2dConvert(OPConvertAutoScanTest): """ @@ -211,9 +210,9 @@ def sample_convert_config(self, draw): axis=0, ).tolist() if data_format == "NCHW": - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding = [[0, 0], [0, 0], *padding1, *padding2] else: - padding = [[0, 0]] + padding1 + padding2 + [[0, 0]] + padding = [[0, 0], *padding1, *padding2, [0, 0]] else: padding = 0 @@ -260,7 +259,7 @@ def forward(self, inputs): padding = self.config["padding"] ceil_mode = self.config["ceil_mode"] data_format = self.config["data_format"] - x = paddle.nn.functional.avg_pool3d( + return paddle.nn.functional.avg_pool3d( inputs, kernel_size, stride=stride, @@ -270,7 +269,6 @@ def forward(self, inputs): divisor_override=None, data_format=data_format, ) - return x class TestAvgpool3dConvert(OPConvertAutoScanTest): @@ -360,9 +358,9 @@ def sample_convert_config(self, draw): axis=0, ).tolist() if data_format == "NCDHW": - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding3 + padding = [[0, 0], [0, 0], *padding1, *padding2, *padding3] else: - padding = [[0, 0]] + padding1 + padding2 + padding3 + [[0, 0]] + padding = [[0, 0], *padding1, *padding2, *padding3, [0, 0]] else: padding = 0 diff --git a/tests/test_auto_scan_pool_max_ops.py b/tests/test_auto_scan_pool_max_ops.py index 2472be174..87767c90a 100755 --- a/tests/test_auto_scan_pool_max_ops.py +++ b/tests/test_auto_scan_pool_max_ops.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class NetMaxpool1d(BaseNet): """ @@ -85,19 +87,13 @@ def sample_convert_config(self, draw): padding = 0 - if return_mask: - opset_version = [[9, 15]] - else: - opset_version = [[7, 9, 15]] + opset_version = [[9, 15]] if return_mask else [[7, 9, 15]] if ceil_mode: opset_version = [10, 15] if padding == "VALID": ceil_mode = False - if return_mask: - op_names = "max_pool2d_with_index" - else: - op_names = "pool2d" + op_names = "max_pool2d_with_index" if return_mask else "pool2d" config = { "op_names": [op_names], @@ -228,28 +224,22 @@ def sample_convert_config(self, draw): axis=0, ).tolist() if data_format == "NCHW": - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding = [[0, 0], [0, 0], *padding1, *padding2] else: - padding = [[0, 0]] + padding1 + padding2 + [[0, 0]] + padding = [[0, 0], *padding1, *padding2, [0, 0]] else: padding = 0 if return_mask and padding_type in ["list2", "list4", "list8"]: padding = draw(st.integers(min_value=1, max_value=5)) - if return_mask: - opset_version = [[9, 15]] - else: - opset_version = [[7, 9, 15]] + opset_version = [[9, 15]] if return_mask else [[7, 9, 15]] if ceil_mode: opset_version = [10, 15] if padding == "VALID": ceil_mode = False - if return_mask: - op_names = "max_pool2d_with_index" - else: - op_names = "pool2d" + op_names = "max_pool2d_with_index" if return_mask else "pool2d" config = { "op_names": [op_names], "test_data_shapes": [input_shape], @@ -392,28 +382,22 @@ def sample_convert_config(self, draw): axis=0, ).tolist() if data_format == "NCDHW": - padding = [[0, 0]] + [[0, 0]] + padding1 + padding2 + padding3 + padding = [[0, 0], [0, 0], *padding1, *padding2, *padding3] else: - padding = [[0, 0]] + padding1 + padding2 + padding3 + [[0, 0]] + padding = [[0, 0], *padding1, *padding2, *padding3, [0, 0]] else: padding = 0 if return_mask and padding_type in ["list3", "list6", "list10"]: padding = draw(st.integers(min_value=1, max_value=5)) - if return_mask: - opset_version = [[9, 15]] - else: - opset_version = [[7, 9, 15]] + opset_version = [[9, 15]] if return_mask else [[7, 9, 15]] if ceil_mode: opset_version = [10, 15] if padding == "VALID": ceil_mode = False - if return_mask: - op_names = "max_pool3d_with_index" - else: - op_names = "pool3d" + op_names = "max_pool3d_with_index" if return_mask else "pool3d" config = { "op_names": [op_names], diff --git a/tests/test_auto_scan_pow.py b/tests/test_auto_scan_pow.py index db774464a..ac24fa206 100644 --- a/tests/test_auto_scan_pow.py +++ b/tests/test_auto_scan_pow.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, x): """ forward """ - x = paddle.pow(x, y=self.config["y"]) - return x + return paddle.pow(x, y=self.config["y"]) class TestPowConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_prelu.py b/tests/test_auto_scan_prelu.py index c4b3d6f8f..a300349d2 100755 --- a/tests/test_auto_scan_prelu.py +++ b/tests/test_auto_scan_prelu.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs, weights): """ forward """ - x = paddle.nn.functional.prelu(inputs, weight=weights) - return x + return paddle.nn.functional.prelu(inputs, weight=weights) class TestPreluConvert(OPConvertAutoScanTest): @@ -42,10 +43,7 @@ def sample_convert_config(self, draw): input_shape = draw( st.lists(st.integers(min_value=5, max_value=20), min_size=0, max_size=4) ) - if len(input_shape) == 0: - weight_shape = [] - else: - weight_shape = [1] + weight_shape = [] if len(input_shape) == 0 else [1] dtype = draw(st.sampled_from(["float32", "float64"])) diff --git a/tests/test_auto_scan_put_along_axis.py b/tests/test_auto_scan_put_along_axis.py index e70d2b23f..60b20bd71 100644 --- a/tests/test_auto_scan_put_along_axis.py +++ b/tests/test_auto_scan_put_along_axis.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir, randtool +import paddle + class Net(BaseNet): """ @@ -28,10 +30,9 @@ def forward(self, arr, indices, values): """ forward """ - x = paddle.put_along_axis( + return paddle.put_along_axis( arr, indices, values, axis=self.config["axis"], reduce=self.config["reduce"] ) - return x class TestPutAlongAxisConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_range.py b/tests/test_auto_scan_range.py index b3a0c9de7..b8ed3ed2d 100755 --- a/tests/test_auto_scan_range.py +++ b/tests/test_auto_scan_range.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): def forward(self): @@ -35,8 +37,7 @@ def forward(self): step = paddle.to_tensor(np.array(step)).astype(self.config["index_dtype"]) dtype = self.config["dtype"] - x = paddle.arange(start=start, end=end, step=step, dtype=dtype) - return x + return paddle.arange(start=start, end=end, step=step, dtype=dtype) class TestArangeConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_reduce_all_or_any.py b/tests/test_auto_scan_reduce_all_or_any.py index cb07fe3b1..78bf92c17 100755 --- a/tests/test_auto_scan_reduce_all_or_any.py +++ b/tests/test_auto_scan_reduce_all_or_any.py @@ -12,11 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st +import random import unittest + +import hypothesis.strategies as st import paddle -import random +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir op_api_map = { @@ -43,13 +44,12 @@ def forward(self, inputs): inputs, axis=self.config["dim"], keepdim=self.config["keep_dim"] ) x = paddle.unsqueeze(x, axis=0) - x = x.astype("int32") - return x + return x.astype("int32") class TestReduceAllConvert(OPConvertAutoScanTest): """ - api: paddle.fluid.layers.reduce_all + api: paddle.all / paddle.any OPset version: 7, 9, 15 """ @@ -88,10 +88,10 @@ def sample_convert_config(self, draw): "input_spec_shape": [], } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) diff --git a/tests/test_auto_scan_reduce_ops.py b/tests/test_auto_scan_reduce_ops.py index a283b1bbb..9423dda99 100755 --- a/tests/test_auto_scan_reduce_ops.py +++ b/tests/test_auto_scan_reduce_ops.py @@ -12,11 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st +import random import unittest + +import hypothesis.strategies as st import paddle -import random +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir op_api_map = { @@ -50,13 +51,12 @@ def forward(self, inputs): x = op_api_map[self.config["op_names"]]( inputs, axis=axis, keepdim=self.config["keep_dim"] ) - x = paddle.unsqueeze(x, axis=[0]) - return x + return paddle.unsqueeze(x, axis=[0]) class TestReduceAllConvert(OPConvertAutoScanTest): """ - api: paddle.fluid.layers.reduce_max/min/mean/sum/prod/ + api: paddle.max/min/mean/sum/prod OPset version: 7, 9, 15 """ @@ -104,10 +104,10 @@ def sample_convert_config(self, draw): "axis_dtype": axis_dtype, } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name if op_name == "reduce_mean": dtype_mean = draw(st.sampled_from(["float32", "float64"])) diff --git a/tests/test_auto_scan_reshape.py b/tests/test_auto_scan_reshape.py index 3cca00f97..1d7c2e150 100755 --- a/tests/test_auto_scan_reshape.py +++ b/tests/test_auto_scan_reshape.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -28,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.reshape(inputs, self.config["shape"]) - return x + return paddle.reshape(inputs, self.config["shape"]) class Net1(BaseNet): @@ -41,8 +42,7 @@ def forward(self, inputs, shape): """ forward """ - x = paddle.reshape(inputs, shape) - return x + return paddle.reshape(inputs, shape) class TestReshapeConvert0(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_rnn.py b/tests/test_auto_scan_rnn.py index c7ef8ddb2..91f829f38 100644 --- a/tests/test_auto_scan_rnn.py +++ b/tests/test_auto_scan_rnn.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -24,7 +26,7 @@ class Net0(BaseNet): """ def __init__(self, config=None): - super(Net0, self).__init__(config) + super().__init__(config) self.lstm = paddle.nn.LSTM( input_size=self.config["input_size"], hidden_size=self.config["hidden_size"], @@ -37,7 +39,7 @@ def forward(self, inputs, prev_h, prev_c): """ forward """ - y, (h, c) = self.lstm(inputs, (prev_h, prev_c)) + y, (_h, _c) = self.lstm(inputs, (prev_h, prev_c)) return y @@ -47,7 +49,7 @@ class Net1(BaseNet): """ def __init__(self, config=None): - super(Net1, self).__init__(config) + super().__init__(config) self.gru = paddle.nn.GRU( input_size=self.config["input_size"], hidden_size=self.config["hidden_size"], @@ -60,7 +62,7 @@ def forward(self, inputs, prev_h): """ forward """ - y, h = self.gru(inputs, prev_h) + y, _h = self.gru(inputs, prev_h) return y @@ -80,14 +82,11 @@ def sample_convert_config(self, draw): num_layers = 2 time_major = draw(st.booleans()) if time_major: - t, b, input_size = input_shape + _t, b, input_size = input_shape else: - b, t, input_size = input_shape + b, _t, input_size = input_shape direction = draw(st.sampled_from(["forward", "bidirect"])) - if direction == "forward": - num_directions = 1 - else: - num_directions = 2 + num_directions = 1 if direction == "forward" else 2 prev_h_shape = [num_layers * num_directions, b, hidden_size] @@ -130,14 +129,11 @@ def sample_convert_config(self, draw): num_layers = 2 time_major = draw(st.booleans()) if time_major: - t, b, input_size = input_shape + _t, b, input_size = input_shape else: - b, t, input_size = input_shape + b, _t, input_size = input_shape direction = draw(st.sampled_from(["forward", "bidirect"])) - if direction == "forward": - num_directions = 1 - else: - num_directions = 2 + num_directions = 1 if direction == "forward" else 2 prev_h_shape = [num_layers * num_directions, b, hidden_size] diff --git a/tests/test_auto_scan_roll.py b/tests/test_auto_scan_roll.py index 785b3fe2c..6cc896534 100644 --- a/tests/test_auto_scan_roll.py +++ b/tests/test_auto_scan_roll.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -35,8 +37,7 @@ def forward(self, inputs): # shifts = [paddle.to_tensor(-2), -2] if self.config["is_shifts_tensor"]: shifts = paddle.to_tensor(shifts).astype(self.config["shift_dtype"]) - x = paddle.roll(inputs, shifts=shifts, axis=axis) - return x + return paddle.roll(inputs, shifts=shifts, axis=axis) class TestRollConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_scale.py b/tests/test_auto_scan_scale.py index 276db52cf..da5cd512b 100755 --- a/tests/test_auto_scan_scale.py +++ b/tests/test_auto_scan_scale.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -32,13 +34,12 @@ def forward(self, x): scale = self.config["scale"] if self.config["isTensor"]: scale = paddle.to_tensor(np.array(scale).astype("float32")) - x = paddle.scale( + return paddle.scale( x, scale=scale, bias=self.config["bias"], bias_after_scale=self.config["bias_after_scale"], ) - return x class TestScaleConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_scatter.py b/tests/test_auto_scan_scatter.py index 14d5414bf..430f81c5f 100755 --- a/tests/test_auto_scan_scatter.py +++ b/tests/test_auto_scan_scatter.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import randtool +import paddle + class Net(BaseNet): """ @@ -28,8 +30,9 @@ def forward(self, inputs, index, updates): """ forward """ - x = paddle.scatter(inputs, index, updates, overwrite=self.config["overwrite"]) - return x + return paddle.scatter( + inputs, index, updates, overwrite=self.config["overwrite"] + ) class TestScatterConvert(OPConvertAutoScanTest): @@ -61,8 +64,7 @@ def sample_convert_config(self, draw): opset_version = [11, 15] def generator_index(): - index_list = randtool("int", 0, input_shape[0], index_shape) - return index_list + return randtool("int", 0, input_shape[0], index_shape) config = { "op_names": ["scatter"], diff --git a/tests/test_auto_scan_scatter_nd_add.py b/tests/test_auto_scan_scatter_nd_add.py index bf2d10347..25f88f555 100755 --- a/tests/test_auto_scan_scatter_nd_add.py +++ b/tests/test_auto_scan_scatter_nd_add.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import randtool +import paddle + class Net(BaseNet): """ @@ -29,8 +31,7 @@ def forward(self, inputs, index, updates): """ forward """ - x = paddle.scatter_nd_add(inputs, index, updates) - return x + return paddle.scatter_nd_add(inputs, index, updates) class TestScatterNdAddConvert(OPConvertAutoScanTest): @@ -60,8 +61,7 @@ def sample_convert_config(self, draw): def generator_index(): min_val = np.min(input_shape) - index_list = randtool("int", 0, min_val, index_shape) - return index_list + return randtool("int", 0, min_val, index_shape) config = { "op_names": ["scatter_nd_add"], diff --git a/tests/test_auto_scan_set_value.py b/tests/test_auto_scan_set_value.py index 4e78a101e..a3d28b33e 100755 --- a/tests/test_auto_scan_set_value.py +++ b/tests/test_auto_scan_set_value.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -import unittest import copy +import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir diff --git a/tests/test_auto_scan_shape.py b/tests/test_auto_scan_shape.py index c364ae80c..9c900870c 100755 --- a/tests/test_auto_scan_shape.py +++ b/tests/test_auto_scan_shape.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.shape(inputs).astype("int32") - return x + return paddle.shape(inputs).astype("int32") class TestShapeConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_shrink_ops.py b/tests/test_auto_scan_shrink_ops.py index 58133c2fb..357386a7b 100755 --- a/tests/test_auto_scan_shrink_ops.py +++ b/tests/test_auto_scan_shrink_ops.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle op_api_map = { @@ -32,7 +34,7 @@ class Net(BaseNet): def forward(self, inputs): - if self.config["op_names"] in ["tanh_shrink"]: + if self.config["op_names"] == "tanh_shrink": x = op_api_map[self.config["op_names"]](inputs) else: x = op_api_map[self.config["op_names"]]( @@ -65,10 +67,10 @@ def sample_convert_config(self, draw): "threshold": threshold, } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = [] + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) diff --git a/tests/test_auto_scan_size.py b/tests/test_auto_scan_size.py index 90ed6a3c0..67a08a4d3 100644 --- a/tests/test_auto_scan_size.py +++ b/tests/test_auto_scan_size.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs): """ forward """ - x = paddle.numel(inputs) - return x + return paddle.numel(inputs) class TestNumelConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_slice.py b/tests/test_auto_scan_slice.py index 4b373a0a3..96a54e6e2 100644 --- a/tests/test_auto_scan_slice.py +++ b/tests/test_auto_scan_slice.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -36,8 +38,7 @@ def forward(self, inputs): starts = paddle.to_tensor(starts) if self.config["isEndsTensor"]: ends = paddle.to_tensor(ends) - x = paddle.slice(inputs, axes=axes, starts=starts, ends=ends) - return x + return paddle.slice(inputs, axes=axes, starts=starts, ends=ends) class TestSliceConvert(OPConvertAutoScanTest): @@ -99,8 +100,7 @@ def forward(self, inputs): starts = paddle.to_tensor(starts) if self.config["isEndsTensor"]: ends = paddle.to_tensor(ends) - x = paddle.slice(inputs, axes=axes, starts=starts, ends=ends) - return x + return paddle.slice(inputs, axes=axes, starts=starts, ends=ends) class TestSliceConvert1(OPConvertAutoScanTest): @@ -169,8 +169,7 @@ def forward(self, inputs): starts = [1, 0, paddle.to_tensor(0), 0] ends = self.config["ends"] ends = [10, 10, paddle.to_tensor(10), 10] - x = paddle.slice(inputs, axes=axes, starts=starts, ends=ends) - return x + return paddle.slice(inputs, axes=axes, starts=starts, ends=ends) class TestSliceConvert2(OPConvertAutoScanTest): @@ -238,8 +237,7 @@ def forward(self, inputs): paddle.to_tensor(np.array(10).astype("int64")), paddle.to_tensor(np.array(10).astype("int64")), ] - x = paddle.slice(inputs, axes=axes, starts=starts, ends=ends) - return x + return paddle.slice(inputs, axes=axes, starts=starts, ends=ends) class TestSliceConvert3(OPConvertAutoScanTest): @@ -291,8 +289,7 @@ def forward(self, inputs): """ forward """ - x = inputs[1:2, 2, :] - return x + return inputs[1:2, 2, :] class TestSliceConvert4(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_softmax.py b/tests/test_auto_scan_softmax.py index fbbe40d99..2bfe19c55 100755 --- a/tests/test_auto_scan_softmax.py +++ b/tests/test_auto_scan_softmax.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -28,9 +30,7 @@ def forward(self, inputs): forward """ - x = paddle.nn.functional.softmax(inputs, axis=self.config["axis"]) - - return x + return paddle.nn.functional.softmax(inputs, axis=self.config["axis"]) class TestSoftmaxConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_softmax_with_cross_entropy.py b/tests/test_auto_scan_softmax_with_cross_entropy.py index 4ff423db7..b0c3db6b0 100644 --- a/tests/test_auto_scan_softmax_with_cross_entropy.py +++ b/tests/test_auto_scan_softmax_with_cross_entropy.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -28,14 +30,13 @@ def forward(self, logits, label): """ forward """ - x = paddle.nn.functional.softmax_with_cross_entropy( + return paddle.nn.functional.softmax_with_cross_entropy( logits=logits, label=label, soft_label=self.config["soft_label"], return_softmax=self.config["return_softmax"], axis=self.config["axis"], ) - return x class TestSoftmaxWithCrossEntropyConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_split.py b/tests/test_auto_scan_split.py index baadab947..72a3e1040 100644 --- a/tests/test_auto_scan_split.py +++ b/tests/test_auto_scan_split.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -import unittest -import paddle import random +import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -32,10 +34,9 @@ def forward(self, inputs): axis = self.config["axis"] if self.config["isAxisTensor"]: axis = paddle.to_tensor(axis, dtype=self.config["axis_dtype"]) - x = paddle.split( + return paddle.split( inputs, num_or_sections=self.config["num_or_sections"], axis=axis ) - return x class TestSplitConvert(OPConvertAutoScanTest): @@ -50,7 +51,7 @@ def sample_convert_config(self, draw): ) # float64 not supported dtype = draw(st.sampled_from(["float32", "int32", "int64"])) - axis_dtype = "int64" # 只能设置为INT64,设置为INT32时会在axis_tensor后增加cast导致取不到constant数值 + axis_dtype = "int64" # 只能设置为INT64,设置为INT32时会在axis_tensor后增加cast导致取不到constant数值 isAxisTensor = draw(st.booleans()) # when axis is negtive, paddle has bug axis = draw(st.integers(min_value=0, max_value=len(input_shape) - 1)) diff --git a/tests/test_auto_scan_squeeze2.py b/tests/test_auto_scan_squeeze2.py index c8027bdfb..8df815794 100755 --- a/tests/test_auto_scan_squeeze2.py +++ b/tests/test_auto_scan_squeeze2.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -35,8 +37,7 @@ def forward(self, inputs): axis = paddle.to_tensor(self.config["axis"]) else: axis = self.config["axis"] - x = paddle.squeeze(inputs, axis=axis) - return x + return paddle.squeeze(inputs, axis=axis) class TestSqueezeConvert(OPConvertAutoScanTest): @@ -55,19 +56,13 @@ def sample_convert_config(self, draw): axis = draw( st.integers(min_value=-len(input_shape), max_value=len(input_shape) - 1) ) - if axis == 0: - axis = [0, -1] - else: - axis = [0, axis] + axis = [0, -1] if axis == 0 else [0, axis] input_shape[axis[0]] = 1 input_shape[axis[1]] = 1 tensor_attr = draw(st.booleans()) - if draw(st.booleans()): - input_spec_shape = [] - else: - input_spec_shape = [len(input_shape) * [-1]] + input_spec_shape = [] if draw(st.booleans()) else [len(input_shape) * [-1]] config = { "op_names": ["squeeze2"], diff --git a/tests/test_auto_scan_stack.py b/tests/test_auto_scan_stack.py index 359b9e9bb..06a483a42 100755 --- a/tests/test_auto_scan_stack.py +++ b/tests/test_auto_scan_stack.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs1, inputs2): """ forward """ - x = paddle.stack([inputs1, inputs2], axis=self.config["axis"]) - return x + return paddle.stack([inputs1, inputs2], axis=self.config["axis"]) class TestStackConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_strided_slice.py b/tests/test_auto_scan_strided_slice.py index ef35dffea..2e631cf6b 100644 --- a/tests/test_auto_scan_strided_slice.py +++ b/tests/test_auto_scan_strided_slice.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -39,10 +41,9 @@ def forward(self, inputs): ends = paddle.to_tensor(np.array(ends).astype("int32")) if self.config["isStridesTensor"]: strides = paddle.to_tensor(np.array(strides).astype("int32")) - x = paddle.strided_slice( + return paddle.strided_slice( inputs, axes=axes, starts=starts, ends=ends, strides=strides ) - return x class TestStridedsliceConvert(OPConvertAutoScanTest): @@ -67,15 +68,9 @@ def sample_convert_config(self, draw): else: starts = [-input_shape[axes[0]], 0, -input_shape[axes[2]] - 22] - if draw(st.booleans()): - ends = [3, 2, 40000] - else: - ends = [-1, 2, 4] + ends = [3, 2, 40000] if draw(st.booleans()) else [-1, 2, 4] - if draw(st.booleans()): - strides = [2, 1, 2] - else: - strides = [1, 1, 1] + strides = [2, 1, 2] if draw(st.booleans()) else [1, 1, 1] tmp = [i for i, val in enumerate(strides) if val == 1] if len(tmp) == len(strides) and isStridesTensor is False: @@ -123,10 +118,9 @@ def forward(self, inputs): # strides = [1, paddle.to_tensor(1).astype('int32'), 1] # strides = [1, paddle.to_tensor(1, dtype='int32'), 1] # strides = [1, paddle.to_tensor(np.array(1).astype("int32")), 1] - x = paddle.strided_slice( + return paddle.strided_slice( inputs, axes=axes, starts=starts, ends=ends, strides=strides ) - return x class TestStridedsliceConvert1(OPConvertAutoScanTest): @@ -151,10 +145,7 @@ def sample_convert_config(self, draw): else: starts = [-input_shape[axes[0]], 0, -input_shape[axes[2]] - 22] - if draw(st.booleans()): - ends = [3, 2, 40000] - else: - ends = [-1, 2, 4] + ends = [3, 2, 40000] if draw(st.booleans()) else [-1, 2, 4] # if draw(st.booleans()): # strides = [2, 1, 2] diff --git a/tests/test_auto_scan_sum.py b/tests/test_auto_scan_sum.py index 18471ff31..c599307f4 100755 --- a/tests/test_auto_scan_sum.py +++ b/tests/test_auto_scan_sum.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -29,8 +31,7 @@ def forward(self, inputs1, inputs2): forward """ inputs = [inputs1, inputs2] - x = paddle.add_n(inputs) - return x + return paddle.add_n(inputs) class TestSumConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_take_along_axis.py b/tests/test_auto_scan_take_along_axis.py index a5f8acf6d..4631c746b 100755 --- a/tests/test_auto_scan_take_along_axis.py +++ b/tests/test_auto_scan_take_along_axis.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -from onnxbase import randtool -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest +from onnxbase import randtool + import paddle @@ -28,8 +30,7 @@ def forward(self, input1, input2): """ forward """ - x = paddle.take_along_axis(input1, input2, axis=self.config["axis"]) - return x + return paddle.take_along_axis(input1, input2, axis=self.config["axis"]) class TestGatherNDConvert(OPConvertAutoScanTest): @@ -58,8 +59,7 @@ def sample_convert_config(self, draw): input2_shape[axis] = 1 def generator_data(): - input_data = randtool("int", 0, input_shape[axis], input2_shape) - return input_data + return randtool("int", 0, input_shape[axis], input2_shape) config = { "op_names": ["take_along_axis"], diff --git a/tests/test_auto_scan_temporal_shift.py b/tests/test_auto_scan_temporal_shift.py index 25b9b7836..83cfeb3d0 100755 --- a/tests/test_auto_scan_temporal_shift.py +++ b/tests/test_auto_scan_temporal_shift.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,12 +29,11 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.temporal_shift( + return paddle.nn.functional.temporal_shift( inputs, seg_num=self.config["seg_num"], shift_ratio=self.config["shift_ratio"], ) - return x class TestTemporal_shiftConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_thresholded_relu.py b/tests/test_auto_scan_thresholded_relu.py index 63836cbcd..fbf648126 100755 --- a/tests/test_auto_scan_thresholded_relu.py +++ b/tests/test_auto_scan_thresholded_relu.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,10 +29,9 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.thresholded_relu( + return paddle.nn.functional.thresholded_relu( inputs, threshold=self.config["threshold"] ) - return x class TestThresholdedReluConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_tile.py b/tests/test_auto_scan_tile.py index 9be580f54..8fec803fa 100755 --- a/tests/test_auto_scan_tile.py +++ b/tests/test_auto_scan_tile.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st import numpy as np -import unittest -import paddle +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -38,8 +40,7 @@ def forward(self, inputs): ) elif self.config["repeat_times_dtype"] == "int": repeat_times = [repeat_times[0]] - x = paddle.tile(inputs, repeat_times=repeat_times) - return x + return paddle.tile(inputs, repeat_times=repeat_times) class TestTileConvert(OPConvertAutoScanTest): @@ -58,10 +59,7 @@ def sample_convert_config(self, draw): repeat_times_dtype = draw(st.sampled_from(["list", "Tensor", "int"])) shape_dtype = draw(st.sampled_from(["int32", "int64"])) - if len(input_shape) == 0: - repeat_times = [10] - else: - repeat_times = input_shape + repeat_times = [10] if len(input_shape) == 0 else input_shape config = { "op_names": ["tile"], "test_data_shapes": [input_shape], @@ -97,8 +95,7 @@ def forward(self, inputs): # np.array([4, 3, 2, 1]).astype('int32')) # not work # repeat_times = [4, 3, paddle.to_tensor(np.array(2).astype("int64")), 1] - x = paddle.tile(inputs, repeat_times=repeat_times) - return x + return paddle.tile(inputs, repeat_times=repeat_times) class TestTileConvert1(OPConvertAutoScanTest): @@ -115,10 +112,7 @@ def sample_convert_config(self, draw): dtype = draw(st.sampled_from(["float32", "float64", "int32", "int64"])) shape_dtype = draw(st.sampled_from(["int32", "int64"])) - if len(input_shape) == 0: - repeat_times = [10] - else: - repeat_times = input_shape + repeat_times = [10] if len(input_shape) == 0 else input_shape # when repeat_times_dtype is tensor has a bug repeat_times_dtype = draw(st.sampled_from(["list", "Tensor"])) diff --git a/tests/test_auto_scan_top_k.py b/tests/test_auto_scan_top_k.py index 8280eaed1..2f7bcc9bb 100755 --- a/tests/test_auto_scan_top_k.py +++ b/tests/test_auto_scan_top_k.py @@ -12,15 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st -import numpy as np -import unittest -import paddle import random +import unittest from random import shuffle + +import hypothesis.strategies as st +import numpy as np +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -34,14 +36,13 @@ def forward(self, input): k = self.config["k"] if self.config["isTensor"]: k = paddle.to_tensor(k, dtype=self.config["k_dtype"]) - x = paddle.topk( + return paddle.topk( input, k=k, axis=self.config["axis"], largest=self.config["largest"], sorted=self.config["sorted"], ) - return x class TestTopkv2Convert(OPConvertAutoScanTest): @@ -70,10 +71,9 @@ def generator_data(): if len(input_shape) == 0: return np.array(10, dtype="float32") prod = np.prod(input_shape) - input_data = np.array(list(range(0, prod))) + input_data = np.array(list(range(prod))) shuffle(input_data) - input_data = input_data.reshape(input_shape) - return input_data + return input_data.reshape(input_shape) if len(input_shape) > 0: if axis is not None: diff --git a/tests/test_auto_scan_transpose.py b/tests/test_auto_scan_transpose.py index 18b8a0d06..0be1eaa1e 100755 --- a/tests/test_auto_scan_transpose.py +++ b/tests/test_auto_scan_transpose.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, x): """ forward """ - x = paddle.transpose(x, perm=self.config["perm"]) - return x + return paddle.transpose(x, perm=self.config["perm"]) class TestTransposeConvert(OPConvertAutoScanTest): @@ -46,7 +47,7 @@ def sample_convert_config(self, draw): dtype = draw(st.sampled_from(["int32", "int64", "float32", "float64"])) if len(input_shape) >= 2: - perm = [i for i in range(len(input_shape))] + perm = list(range(len(input_shape))) perm[0], perm[1] = perm[1], perm[0] elif len(input_shape) == 1: perm = [0] diff --git a/tests/test_auto_scan_unary_ops.py b/tests/test_auto_scan_unary_ops.py index 65d9bd240..ee285144f 100755 --- a/tests/test_auto_scan_unary_ops.py +++ b/tests/test_auto_scan_unary_ops.py @@ -11,9 +11,11 @@ # 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 auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle op_api_map = { @@ -112,15 +114,13 @@ def sample_convert_config(self, draw): "opset_version": [7], "input_spec_shape": [], } - models = list() - op_names = list() - opset_versions = list() - for op_name, i in op_api_map.items(): + models = [] + op_names = [] + opset_versions = list(opset_version_map.values()) + for op_name in op_api_map: config["op_names"] = op_name models.append(Net(config)) op_names.append(op_name) - for op_name, vs in opset_version_map.items(): - opset_versions.append(vs) config["op_names"] = op_names config["opset_version"] = opset_versions return (config, models) diff --git a/tests/test_auto_scan_unfold.py b/tests/test_auto_scan_unfold.py index caf405f5f..119ea730f 100755 --- a/tests/test_auto_scan_unfold.py +++ b/tests/test_auto_scan_unfold.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,14 +30,13 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.unfold( + return paddle.nn.functional.unfold( inputs, self.config["kernel_size"], strides=self.config["strides"], paddings=self.config["paddings"], dilations=self.config["dilations"], ) - return x class TestUnfoldConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_unique.py b/tests/test_auto_scan_unique.py index adce8efe4..5be6ed29f 100755 --- a/tests/test_auto_scan_unique.py +++ b/tests/test_auto_scan_unique.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,7 +29,7 @@ def forward(self, input): """ forward """ - x = paddle.unique( + return paddle.unique( input, return_index=self.config["return_index"], return_inverse=self.config["return_inverse"], @@ -36,8 +38,6 @@ def forward(self, input): dtype=self.config["dtype"], ) - return x - class TestUniqueConvert(OPConvertAutoScanTest): """ diff --git a/tests/test_auto_scan_unsqueeze2.py b/tests/test_auto_scan_unsqueeze2.py index 31b469275..de4c252f8 100755 --- a/tests/test_auto_scan_unsqueeze2.py +++ b/tests/test_auto_scan_unsqueeze2.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_only_pir +import paddle + class Net(BaseNet): """ @@ -33,8 +35,7 @@ def forward(self, inputs): axis = paddle.to_tensor(axis) if self.config["isTensor13"]: axis = axis * 1 - x = paddle.unsqueeze(inputs, axis=axis) - return x + return paddle.unsqueeze(inputs, axis=axis) class TestUnsqueezeConvert(OPConvertAutoScanTest): @@ -65,10 +66,7 @@ def sample_convert_config(self, draw): if len(input_shape) == 3: axis = [1, 2, 3] if len(input_shape) == 2: - if draw(st.booleans()): - axis = [0, 1, 2] - else: - axis = [1, 3] + axis = [0, 1, 2] if draw(st.booleans()) else [1, 3] isTensor13 = draw(st.booleans()) opset_version = [7, 9, 10, 11, 12, 13, 14, 15] if isTensor13 or isTensor: diff --git a/tests/test_auto_scan_unstack.py b/tests/test_auto_scan_unstack.py index 1f8ac273c..d3a150a89 100644 --- a/tests/test_auto_scan_unstack.py +++ b/tests/test_auto_scan_unstack.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -27,8 +29,7 @@ def forward(self, inputs): """ forward """ - x = paddle.unstack(inputs, axis=self.config["axis"], num=self.config["num"]) - return x + return paddle.unstack(inputs, axis=self.config["axis"], num=self.config["num"]) class TestUnstackConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_where.py b/tests/test_auto_scan_where.py index 4377f6b96..5a55fe82a 100755 --- a/tests/test_auto_scan_where.py +++ b/tests/test_auto_scan_where.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest -import paddle + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import _test_with_pir +import paddle + class Net(BaseNet): """ @@ -28,8 +30,7 @@ def forward(self, inputs1, inputs2): """ forward """ - x = paddle.where(inputs1 < inputs2, inputs1, inputs2) - return x + return paddle.where(inputs1 < inputs2, inputs1, inputs2) class TestWhereConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_where_index.py b/tests/test_auto_scan_where_index.py index 66194c71e..c17bbbc4e 100755 --- a/tests/test_auto_scan_where_index.py +++ b/tests/test_auto_scan_where_index.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet -import hypothesis.strategies as st import unittest + +import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest + import paddle @@ -29,8 +31,7 @@ def forward(self, inputs): """ condition = paddle.cast(inputs, "bool") - x = paddle.nonzero(condition) - return x + return paddle.nonzero(condition) class TestWhereIndexConvert(OPConvertAutoScanTest): diff --git a/tests/test_auto_scan_yolo_box.py b/tests/test_auto_scan_yolo_box.py index 14f4fb7fd..b3cfe0ed7 100755 --- a/tests/test_auto_scan_yolo_box.py +++ b/tests/test_auto_scan_yolo_box.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from auto_scan_test import OPConvertAutoScanTest, BaseNet +import unittest + import hypothesis.strategies as st +from auto_scan_test import BaseNet, OPConvertAutoScanTest from onnxbase import randtool -import unittest + import paddle @@ -34,7 +36,7 @@ def forward(self, inputs_1, inputs_2): downsample_ratio = self.config["downsample_ratio"] clip_bbox = self.config["clip_bbox"] scale_x_y = self.config["scale_x_y"] - x = paddle.vision.ops.yolo_box( + return paddle.vision.ops.yolo_box( inputs_1, inputs_2, anchors=anchors, @@ -44,7 +46,6 @@ def forward(self, inputs_1, inputs_2): clip_bbox=clip_bbox, scale_x_y=scale_x_y, ) - return x class TestYoloBoxConvert(OPConvertAutoScanTest): @@ -84,8 +85,7 @@ def sample_convert_config(self, draw): dtype = draw(st.sampled_from(["float32", "float64"])) def generator_data(): - input_data = randtool("int", 320, 640, img_size) - return input_data + return randtool("int", 320, 640, img_size) input_shape[1] = num * (5 + class_num) diff --git a/tests/test_avg_pool2d.py b/tests/test_avg_pool2d.py index 52c74da33..9c1c5a19e 100644 --- a/tests/test_avg_pool2d.py +++ b/tests/test_avg_pool2d.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.avg_pool2d(inputs, kernel_size=2) - return x + return paddle.nn.functional.avg_pool2d(inputs, kernel_size=2) @_test_with_pir diff --git a/tests/test_bitwise.py b/tests/test_bitwise.py index c93e0b84e..054065ed9 100644 --- a/tests/test_bitwise.py +++ b/tests/test_bitwise.py @@ -12,18 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir class BitwiseAndNet(paddle.nn.Layer): def __init__(self): - super(BitwiseAndNet, self).__init__() + super().__init__() def forward(self, x, y): - x = paddle.bitwise_and(x, y) - return x + return paddle.bitwise_and(x, y) @_test_with_pir @@ -80,11 +79,10 @@ def test_bitwise_and_bool_type_18(): class BitwiseNotNet(paddle.nn.Layer): def __init__(self): - super(BitwiseNotNet, self).__init__() + super().__init__() def forward(self, x): - x = paddle.bitwise_not(x) - return x + return paddle.bitwise_not(x) @_test_with_pir @@ -131,11 +129,10 @@ def test_bitwise_not_bool_type_18(): class BitwiseOrNet(paddle.nn.Layer): def __init__(self): - super(BitwiseOrNet, self).__init__() + super().__init__() def forward(self, x, y): - x = paddle.bitwise_or(x, y) - return x + return paddle.bitwise_or(x, y) @_test_with_pir @@ -192,11 +189,10 @@ def test_bitwise_or_bool_type_18(): class BitwiseXorNet(paddle.nn.Layer): def __init__(self): - super(BitwiseXorNet, self).__init__() + super().__init__() def forward(self, x, y): - x = paddle.bitwise_xor(x, y) - return x + return paddle.bitwise_xor(x, y) @_test_with_pir diff --git a/tests/test_bmm.py b/tests/test_bmm.py index 4020a02dc..7302e3bbf 100644 --- a/tests/test_bmm.py +++ b/tests/test_bmm.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ diff --git a/tests/test_broadcast_to.py b/tests/test_broadcast_to.py index 1aa4412ef..7660b0865 100644 --- a/tests/test_broadcast_to.py +++ b/tests/test_broadcast_to.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx +import paddle + class Net(paddle.nn.Layer): """ @@ -22,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.broadcast_to(inputs, shape=[2, 3]) - return x + return paddle.broadcast_to(inputs, shape=[2, 3]) def test_broadcast_to_base(): diff --git a/tests/test_cast.py b/tests/test_cast.py index 1e08486d0..8bbbce2ec 100755 --- a/tests/test_cast.py +++ b/tests/test_cast.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.cast(inputs, "float64") - return x + return paddle.cast(inputs, "float64") @_test_with_pir diff --git a/tests/test_ceil.py b/tests/test_ceil.py index 3ac5033f1..7ff0dc350 100644 --- a/tests/test_ceil.py +++ b/tests/test_ceil.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.ceil(inputs) - return x + return paddle.ceil(inputs) @_test_with_pir diff --git a/tests/test_clip.py b/tests/test_clip.py index d0ec2eab0..5a358f561 100644 --- a/tests/test_clip.py +++ b/tests/test_clip.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.clip(inputs) - return x + return paddle.clip(inputs) @_test_with_pir diff --git a/tests/test_concat.py b/tests/test_concat.py index 822c791a3..1bd0b8bbf 100644 --- a/tests/test_concat.py +++ b/tests/test_concat.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.concat([inputs, inputs_]) - return x + return paddle.concat([inputs, inputs_]) @_test_with_pir diff --git a/tests/test_cos.py b/tests/test_cos.py index aeb0bb607..ceaf0278e 100644 --- a/tests/test_cos.py +++ b/tests/test_cos.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.cos(inputs) - return x + return paddle.cos(inputs) @_test_with_pir diff --git a/tests/test_cosh.py b/tests/test_cosh.py index 2151cabde..4a40a7dd8 100644 --- a/tests/test_cosh.py +++ b/tests/test_cosh.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.cosh(inputs) - return x + return paddle.cosh(inputs) def test_cosh_9(): diff --git a/tests/test_cumsum.py b/tests/test_cumsum.py index 1ff9777e9..75273d8cb 100644 --- a/tests/test_cumsum.py +++ b/tests/test_cumsum.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.cumsum(inputs, axis=0) - return x + return paddle.cumsum(inputs, axis=0) @_test_with_pir diff --git a/tests/test_dequantize_linear.py b/tests/test_dequantize_linear.py index a12c55de0..d9be7e4a9 100755 --- a/tests/test_dequantize_linear.py +++ b/tests/test_dequantize_linear.py @@ -13,14 +13,16 @@ # limitations under the License. import os -import paddle -import numpy as np -import paddle2onnx import unittest + +import numpy as np import onnxruntime as ort -from paddle.base import unique_name from onnxbase import _test_only_pir +import paddle +import paddle2onnx +from paddle.base import unique_name + def convert_scale_to_paddle(onnx_scale, qmax): return onnx_scale * qmax / 4 @@ -50,19 +52,21 @@ def build_static_net(input_shape, quant_axis, scale_shape, qmin, qmax, type): stop_gradient=True, ) - dequant_out, out_state, out_accum, out_scale = paddle._C_ops.dequantize_linear( - x, - scale, - zero_points, - accum, - state, - quant_axis, - 8, # bit_length - qmin, # qmin - qmax, # qmax - 0, # rounding_type - True, # is_test - False, # only_observer + dequant_out, _out_state, _out_accum, _out_scale = ( + paddle._C_ops.dequantize_linear( + x, + scale, + zero_points, + accum, + state, + quant_axis, + 8, # bit_length + qmin, # qmin + qmax, # qmax + 0, # rounding_type + True, # is_test + False, # only_observer + ) ) model_dir = f"./dequantize_linear_model_{type}" diff --git a/tests/test_dist.py b/tests/test_dist.py index 2783b3903..069fd06c7 100644 --- a/tests/test_dist.py +++ b/tests/test_dist.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, p=2): - super(Net, self).__init__() + super().__init__() self.p = p def forward(self, inputs, _inputs): """ forward """ - x = paddle.dist(inputs, _inputs, p=self.p) - return x + return paddle.dist(inputs, _inputs, p=self.p) def test_dist_9(): diff --git a/tests/test_divide.py b/tests/test_divide.py index a78337ebf..e0d63a7dd 100644 --- a/tests/test_divide.py +++ b/tests/test_divide.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.divide(inputs, inputs_) - return x + return paddle.divide(inputs, inputs_) def test_divide_9(): diff --git a/tests/test_dot.py b/tests/test_dot.py index 2e5e84b4e..980126bb8 100644 --- a/tests/test_dot.py +++ b/tests/test_dot.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.dot(inputs, inputs_) - return x + return paddle.dot(inputs, inputs_) def test_dot_9(): diff --git a/tests/test_dygraph2onnx.py b/tests/test_dygraph2onnx.py index a43e99587..0f264629d 100644 --- a/tests/test_dygraph2onnx.py +++ b/tests/test_dygraph2onnx.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle import unittest + +import paddle import paddle2onnx diff --git a/tests/test_einsum.py b/tests/test_einsum.py index 0413f83a1..0ff329a7b 100644 --- a/tests/test_einsum.py +++ b/tests/test_einsum.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir @_test_with_pir @@ -30,14 +30,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, input): """ forward """ - x = paddle.einsum("i->", input) - return x + return paddle.einsum("i->", input) op = Net() op.eval() @@ -60,14 +59,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, x, y): """ forward """ - x = paddle.einsum("i,i->", x, y) - return x + return paddle.einsum("i,i->", x, y) op = Net() op.eval() @@ -91,14 +89,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, x, y): """ forward """ - x = paddle.einsum("i,j->ij", x, y) - return x + return paddle.einsum("i,j->ij", x, y) op = Net() op.eval() @@ -123,14 +120,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, x): """ forward """ - x = paddle.einsum("ijk->kji", x) - return x + return paddle.einsum("ijk->kji", x) op = Net() op.eval() @@ -154,14 +150,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, x, y): """ forward """ - x = paddle.einsum("ijk, ikl->ijl", x, y) - return x + return paddle.einsum("ijk, ikl->ijl", x, y) op = Net() op.eval() @@ -186,14 +181,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, x): """ forward """ - x = paddle.einsum("...jk->...kj", x) - return x + return paddle.einsum("...jk->...kj", x) op = Net() op.eval() @@ -217,14 +211,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, x, y): """ forward """ - x = paddle.einsum("...jk, ...kl->...jl", x, y) - return x + return paddle.einsum("...jk, ...kl->...jl", x, y) op = Net() op.eval() diff --git a/tests/test_empty.py b/tests/test_empty.py index f3fb8f690..4e9749809 100644 --- a/tests/test_empty.py +++ b/tests/test_empty.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx, _test_with_pir +import paddle + class Net(paddle.nn.Layer): """ @@ -22,16 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, shape): """ forward """ x = paddle.empty(shape, dtype=paddle.int64) - x = paddle.zeros_like(x) - - return x + return paddle.zeros_like(x) @_test_with_pir diff --git a/tests/test_equal.py b/tests/test_equal.py index 106e09239..74df7a2bf 100644 --- a/tests/test_equal.py +++ b/tests/test_equal.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.equal(inputs, inputs_) - return x + return paddle.equal(inputs, inputs_) # def test_equal_9(): diff --git a/tests/test_erf.py b/tests/test_erf.py index 2beee1041..862a1c24a 100644 --- a/tests/test_erf.py +++ b/tests/test_erf.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.erf(inputs) - return x + return paddle.erf(inputs) def test_erf_9(): diff --git a/tests/test_exp.py b/tests/test_exp.py index 25f7b9793..5d525a6a0 100644 --- a/tests/test_exp.py +++ b/tests/test_exp.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.exp(inputs) - return x + return paddle.exp(inputs) @_test_with_pir diff --git a/tests/test_expand.py b/tests/test_expand.py index a8e75f589..ec667dacb 100644 --- a/tests/test_expand.py +++ b/tests/test_expand.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.expand(inputs, shape=[2, 3, 10]) - return x + return paddle.expand(inputs, shape=[2, 3, 10]) @_test_with_pir diff --git a/tests/test_expand_as.py b/tests/test_expand_as.py index d82395cf0..67eda19c7 100644 --- a/tests/test_expand_as.py +++ b/tests/test_expand_as.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.expand_as(inputs, inputs_) - return x + return paddle.expand_as(inputs, inputs_) def test_expand_as_9(): diff --git a/tests/test_fft_r2c.py b/tests/test_fft_r2c.py index dbe6d41f7..0b2dd3dbd 100644 --- a/tests/test_fft_r2c.py +++ b/tests/test_fft_r2c.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_only_pir class Net(paddle.nn.Layer): @@ -24,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ x = paddle.fft.rfft(inputs, axis=1) - x = paddle.abs(x) - return x + return paddle.abs(x) @_test_only_pir diff --git a/tests/test_fill_constant.py b/tests/test_fill_constant.py index 698f12581..3c75a03ff 100644 --- a/tests/test_fill_constant.py +++ b/tests/test_fill_constant.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx +import paddle + class Net(paddle.nn.Layer): def forward(self, shape): diff --git a/tests/test_flatten.py b/tests/test_flatten.py index 2db2f5168..698f098a8 100644 --- a/tests/test_flatten.py +++ b/tests/test_flatten.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.flatten(inputs, start_axis=1, stop_axis=2) - return x + return paddle.flatten(inputs, start_axis=1, stop_axis=2) @_test_with_pir diff --git a/tests/test_floor.py b/tests/test_floor.py index d11f2f925..b6dcf2d54 100644 --- a/tests/test_floor.py +++ b/tests/test_floor.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.floor(inputs) - return x + return paddle.floor(inputs) @_test_with_pir diff --git a/tests/test_floor_divide.py b/tests/test_floor_divide.py index 523cbadc8..8281ee3e4 100644 --- a/tests/test_floor_divide.py +++ b/tests/test_floor_divide.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.floor_divide(inputs, inputs_) - return x + return paddle.floor_divide(inputs, inputs_) @_test_with_pir diff --git a/tests/test_floor_mod.py b/tests/test_floor_mod.py index 3392d364c..b6a4d975d 100644 --- a/tests/test_floor_mod.py +++ b/tests/test_floor_mod.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx +import paddle + class Net(paddle.nn.Layer): """ @@ -22,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, _inputs): """ forward """ - x = paddle.floor_mod(inputs, _inputs) - return x + return paddle.floor_mod(inputs, _inputs) def test_floor_mod_10(): diff --git a/tests/test_full_with_tensor.py b/tests/test_full_with_tensor.py index cf349fd3a..5c5808591 100644 --- a/tests/test_full_with_tensor.py +++ b/tests/test_full_with_tensor.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_only_pir class Net1(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net1(paddle.nn.Layer): """ def __init__(self): - super(Net1, self).__init__() + super().__init__() def forward(self, shape): """ forward """ - x = paddle.full(shape, fill_value=3) - return x + return paddle.full(shape, fill_value=3) @_test_only_pir @@ -52,14 +51,13 @@ class Net2(paddle.nn.Layer): """ def __init__(self): - super(Net2, self).__init__() + super().__init__() def forward(self, shape, fill_value): """ forward """ - x = paddle.full(shape, fill_value) - return x + return paddle.full(shape, fill_value) @_test_only_pir diff --git a/tests/test_gather.py b/tests/test_gather.py index a2540edb6..770e4dd56 100644 --- a/tests/test_gather.py +++ b/tests/test_gather.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_only_pir class Net(paddle.nn.Layer): @@ -24,18 +23,17 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.gather( + return paddle.gather( inputs, index=paddle.to_tensor([1, 2], dtype="int64"), axis=paddle.to_tensor([0]), ) - return x @_test_only_pir @@ -95,16 +93,15 @@ class Net2(paddle.nn.Layer): """ def __init__(self): - super(Net2, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.gather( + return paddle.gather( inputs, index=paddle.to_tensor([[1], [2]], dtype="int64"), axis=1 ) - return x # Attention : GatherND don't have opset < 11 version, so we don't test it. @@ -150,14 +147,15 @@ class Net3(paddle.nn.Layer): """ def __init__(self): - super(Net3, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.gather(inputs, index=paddle.to_tensor([0, 1], dtype="int64"), axis=1) - return x + return paddle.gather( + inputs, index=paddle.to_tensor([0, 1], dtype="int64"), axis=1 + ) @_test_only_pir @@ -175,9 +173,9 @@ def test_gather_7_3(): print(data.shape) obj.set_input_data("input_data", data) obj.run() - assert len(obj.res_fict["7"][0].shape) == len( - data.shape - ), "The result of ONNX inference is not equal to Paddle inference!\n" + assert len(obj.res_fict["7"][0].shape) == len(data.shape), ( + "The result of ONNX inference is not equal to Paddle inference!\n" + ) @_test_only_pir @@ -195,9 +193,9 @@ def test_gather_11_3(): print(data.shape) obj.set_input_data("input_data", data) obj.run() - assert len(obj.res_fict["11"][0].shape) == len( - data.shape - ), "The result of ONNX inference is not equal to Paddle inference!\n" + assert len(obj.res_fict["11"][0].shape) == len(data.shape), ( + "The result of ONNX inference is not equal to Paddle inference!\n" + ) @_test_only_pir @@ -216,9 +214,9 @@ def test_gather_13_3(): obj.set_input_data("input_data", data) obj.run() - assert len(obj.res_fict["13"][0].shape) == len( - data.shape - ), "The result of ONNX inference is not equal to Paddle inference!\n" + assert len(obj.res_fict["13"][0].shape) == len(data.shape), ( + "The result of ONNX inference is not equal to Paddle inference!\n" + ) class Net4(paddle.nn.Layer): @@ -227,16 +225,15 @@ class Net4(paddle.nn.Layer): """ def __init__(self): - super(Net4, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.gather( + return paddle.gather( inputs, index=paddle.to_tensor([[0], [1]], dtype="int64"), axis=2 ) - return x @_test_only_pir @@ -271,6 +268,6 @@ def test_gather_13_4(): print(len(data.shape)) obj.set_input_data("input_data", data) obj.run() - assert len(obj.res_fict["13"][0].shape) == len( - data.shape - ), "The result of ONNX inference is not equal to Paddle inference!\n" + assert len(obj.res_fict["13"][0].shape) == len(data.shape), ( + "The result of ONNX inference is not equal to Paddle inference!\n" + ) diff --git a/tests/test_gelu.py b/tests/test_gelu.py index b7d37be39..1c01efdc2 100644 --- a/tests/test_gelu.py +++ b/tests/test_gelu.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.gelu(inputs) - return x + return paddle.nn.functional.gelu(inputs) @_test_with_pir diff --git a/tests/test_glu.py b/tests/test_glu.py index 61fddca81..27920fa0e 100644 --- a/tests/test_glu.py +++ b/tests/test_glu.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.glu(inputs) - return x + return paddle.nn.functional.glu(inputs) def test_glu_7(): diff --git a/tests/test_greater_equal.py b/tests/test_greater_equal.py index 77c0214f6..388c035b3 100644 --- a/tests/test_greater_equal.py +++ b/tests/test_greater_equal.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.greater_equal(inputs, inputs_) - return x + return paddle.greater_equal(inputs, inputs_) @_test_with_pir diff --git a/tests/test_greater_than.py b/tests/test_greater_than.py index 3fd7272c2..5b76e8279 100644 --- a/tests/test_greater_than.py +++ b/tests/test_greater_than.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ diff --git a/tests/test_hardsigmoid.py b/tests/test_hardsigmoid.py index 1020a523b..312048fb7 100644 --- a/tests/test_hardsigmoid.py +++ b/tests/test_hardsigmoid.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.hardsigmoid(inputs) - return x + return paddle.nn.functional.hardsigmoid(inputs) @_test_with_pir diff --git a/tests/test_hardswish.py b/tests/test_hardswish.py index c67aaa850..3ddd6dff9 100644 --- a/tests/test_hardswish.py +++ b/tests/test_hardswish.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.hardswish(inputs) - return x + return paddle.nn.functional.hardswish(inputs) @_test_with_pir diff --git a/tests/test_hardtanh.py b/tests/test_hardtanh.py index aa2554eef..3bed3cc33 100644 --- a/tests/test_hardtanh.py +++ b/tests/test_hardtanh.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -22,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.hardtanh(inputs) - return x + return paddle.nn.functional.hardtanh(inputs) @_test_with_pir diff --git a/tests/test_ifelse.py b/tests/test_ifelse.py index 84e43769b..acf212477 100644 --- a/tests/test_ifelse.py +++ b/tests/test_ifelse.py @@ -12,19 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx +import paddle + class BaseNet1(paddle.nn.Layer): def __init__(self): - super(BaseNet1, self).__init__() + super().__init__() def forward(self, inputs): if inputs == 1: return inputs * 1 - else: - return inputs * 3 + return inputs * 3 def test_ifelse_1_true(): @@ -45,13 +45,12 @@ def test_ifelse_1_false(): class BaseNet2(paddle.nn.Layer): def __init__(self): - super(BaseNet2, self).__init__() + super().__init__() def forward(self, cond, inputs): if cond == 1: return inputs * 1, inputs * 2 - else: - return inputs * 3, inputs * 4 + return inputs * 3, inputs * 4 def test_ifelse_2_true(): @@ -72,13 +71,12 @@ def test_ifelse_2_false(): class BaseNet3(paddle.nn.Layer): def __init__(self): - super(BaseNet3, self).__init__() + super().__init__() def forward(self, inputs): if inputs == 1: return 1 - else: - return 2 + return 2 def test_ifelse_3_true(): @@ -99,13 +97,12 @@ def test_ifelse_3_false(): class BaseNet4(paddle.nn.Layer): def __init__(self): - super(BaseNet4, self).__init__() + super().__init__() def forward(self, inputs): if inputs == 1: return inputs + 1 - else: - return 2 + return 2 def test_ifelse_4_true(): @@ -126,13 +123,12 @@ def test_ifelse_4_false(): class BaseNet5(paddle.nn.Layer): def __init__(self): - super(BaseNet5, self).__init__() + super().__init__() def forward(self, inputs): if inputs == 1: return 1, 2 - else: - return 2, 3 + return 2, 3 def test_ifelse_5_true(): diff --git a/tests/test_index_select.py b/tests/test_index_select.py index 4dc7edc95..9e91eb6bb 100644 --- a/tests/test_index_select.py +++ b/tests/test_index_select.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,17 +23,16 @@ class Net(paddle.nn.Layer): """ def __init__(self, axis=0): - super(Net, self).__init__() + super().__init__() self.axis = axis def forward(self, inputs): """ forward """ - x = paddle.index_select( + return paddle.index_select( inputs, index=paddle.to_tensor([1, 2], dtype="int64"), axis=self.axis ) - return x @_test_with_pir diff --git a/tests/test_isfinite.py b/tests/test_isfinite.py index 1eb9dd405..5e2b3b026 100644 --- a/tests/test_isfinite.py +++ b/tests/test_isfinite.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ diff --git a/tests/test_isinf.py b/tests/test_isinf.py index fed182a41..8aaf4814a 100644 --- a/tests/test_isinf.py +++ b/tests/test_isinf.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ @@ -67,7 +67,7 @@ def test_isinf_10(): obj.set_input_data( "input_data", paddle.to_tensor( - ([float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")]) + [float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")] ), ) obj.run() @@ -86,7 +86,7 @@ def test_isinf_11(): obj.set_input_data( "input_data", paddle.to_tensor( - ([float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")]) + [float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")] ), ) obj.run() @@ -105,7 +105,7 @@ def test_isinf_12(): obj.set_input_data( "input_data", paddle.to_tensor( - ([float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")]) + [float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")] ), ) obj.run() diff --git a/tests/test_isnan.py b/tests/test_isnan.py index f98d752e4..572cf77d8 100644 --- a/tests/test_isnan.py +++ b/tests/test_isnan.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ @@ -67,7 +67,7 @@ def test_isnan_9(): obj.set_input_data( "input_data", paddle.to_tensor( - ([float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")]) + [float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")] ), ) obj.run() @@ -86,7 +86,7 @@ def test_isnan_10(): obj.set_input_data( "input_data", paddle.to_tensor( - ([float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")]) + [float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")] ), ) obj.run() @@ -105,7 +105,7 @@ def test_isnan_11(): obj.set_input_data( "input_data", paddle.to_tensor( - ([float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")]) + [float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")] ), ) obj.run() @@ -124,7 +124,7 @@ def test_isnan_12(): obj.set_input_data( "input_data", paddle.to_tensor( - ([float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")]) + [float("-inf"), -2, 3.6, float("inf"), 0, float("-nan"), float("nan")] ), ) obj.run() diff --git a/tests/test_leaky_relu.py b/tests/test_leaky_relu.py index cc88b7a2a..7f6d66523 100644 --- a/tests/test_leaky_relu.py +++ b/tests/test_leaky_relu.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.leaky_relu(inputs) - return x + return paddle.nn.functional.leaky_relu(inputs) @_test_with_pir diff --git a/tests/test_less_equal.py b/tests/test_less_equal.py index d4500c366..b4d9af91e 100644 --- a/tests/test_less_equal.py +++ b/tests/test_less_equal.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.less_equal(inputs, inputs_) - return x + return paddle.less_equal(inputs, inputs_) def test_less_equal_12(): diff --git a/tests/test_less_than.py b/tests/test_less_than.py index 91afe511c..795030ade 100644 --- a/tests/test_less_than.py +++ b/tests/test_less_than.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.less_than(inputs, inputs_) - return x + return paddle.less_than(inputs, inputs_) @_test_with_pir diff --git a/tests/test_log10.py b/tests/test_log10.py index 5b4151a0f..4edb3a435 100644 --- a/tests/test_log10.py +++ b/tests/test_log10.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.log10(inputs) - return x + return paddle.log10(inputs) def test_log10_7(): diff --git a/tests/test_log1p.py b/tests/test_log1p.py index 297578ddd..fd938569f 100644 --- a/tests/test_log1p.py +++ b/tests/test_log1p.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.log1p(inputs) - return x + return paddle.log1p(inputs) def test_log1p_7(): diff --git a/tests/test_log2.py b/tests/test_log2.py index 602c91ddf..e929e6da9 100644 --- a/tests/test_log2.py +++ b/tests/test_log2.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.log2(inputs) - return x + return paddle.log2(inputs) def test_log2_7(): diff --git a/tests/test_logical_and.py b/tests/test_logical_and.py index fb3abccc9..237315266 100644 --- a/tests/test_logical_and.py +++ b/tests/test_logical_and.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.logical_and(inputs, inputs_) - return x + return paddle.logical_and(inputs, inputs_) @_test_with_pir diff --git a/tests/test_logical_not.py b/tests/test_logical_not.py index 86be25f0e..012f4113f 100644 --- a/tests/test_logical_not.py +++ b/tests/test_logical_not.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.logical_not(inputs) - return x + return paddle.logical_not(inputs) @_test_with_pir diff --git a/tests/test_logical_or.py b/tests/test_logical_or.py index aeab8e479..ab0fed1f8 100644 --- a/tests/test_logical_or.py +++ b/tests/test_logical_or.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.logical_or(inputs, inputs_) - return x + return paddle.logical_or(inputs, inputs_) def test_logical_or_7(): diff --git a/tests/test_logical_xor.py b/tests/test_logical_xor.py index a2d8afa50..e34b93ef6 100644 --- a/tests/test_logical_xor.py +++ b/tests/test_logical_xor.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.logical_xor(inputs, inputs_) - return x + return paddle.logical_xor(inputs, inputs_) def test_logical_xor_7(): diff --git a/tests/test_mask_select.py b/tests/test_mask_select.py index 33ed36da8..d609e7901 100644 --- a/tests/test_mask_select.py +++ b/tests/test_mask_select.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, mask): """ forward """ - x = paddle.masked_select(inputs, mask) - return x + return paddle.masked_select(inputs, mask) @_test_with_pir diff --git a/tests/test_matmul.py b/tests/test_matmul.py index f5dd47431..2a8a2c40d 100644 --- a/tests/test_matmul.py +++ b/tests/test_matmul.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.matmul(inputs, inputs_, transpose_x=False, transpose_y=True) - return x + return paddle.matmul(inputs, inputs_, transpose_x=False, transpose_y=True) @_test_with_pir diff --git a/tests/test_median.py b/tests/test_median.py index 727d8cf13..38832f6b3 100644 --- a/tests/test_median.py +++ b/tests/test_median.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx, _test_with_pir, randtool +import paddle + class Net(paddle.nn.Layer): """ @@ -22,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.median(inputs, axis=None, keepdim=False, name=None) - return x + return paddle.median(inputs, axis=None, keepdim=False, name=None) @_test_with_pir diff --git a/tests/test_meshgrid.py b/tests/test_meshgrid.py index b043850a9..5a5037adb 100644 --- a/tests/test_meshgrid.py +++ b/tests/test_meshgrid.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, _inputs): """ @@ -75,7 +75,7 @@ class Net_3(paddle.nn.Layer): """ def __init__(self): - super(Net_3, self).__init__() + super().__init__() def forward(self, inputs, _inputs, _input): """ diff --git a/tests/test_mod.py b/tests/test_mod.py index 55acf4908..26430b9c6 100644 --- a/tests/test_mod.py +++ b/tests/test_mod.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx +import paddle + class Net(paddle.nn.Layer): """ @@ -22,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.mod(inputs, inputs_) - return x + return paddle.mod(inputs, inputs_) def test_mod_10(): diff --git a/tests/test_multiclass_nms.py b/tests/test_multiclass_nms.py index 15c7f6b21..c5ac7be97 100644 --- a/tests/test_multiclass_nms.py +++ b/tests/test_multiclass_nms.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_only_pir class BaseNet(paddle.nn.Layer): def __init__(self, config): - super(BaseNet, self).__init__() + super().__init__() self.score_threshold = config["score_threshold"] self.nms_top_k = config["nms_top_k"] self.keep_top_k = config["keep_top_k"] diff --git a/tests/test_mv.py b/tests/test_mv.py index af4034479..e3c6db34d 100644 --- a/tests/test_mv.py +++ b/tests/test_mv.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, _ver): """ forward """ - x = paddle.mv(inputs, _ver) - return x + return paddle.mv(inputs, _ver) def test_mv_9(): diff --git a/tests/test_neg.py b/tests/test_neg.py index 2695e231e..f066f95fe 100644 --- a/tests/test_neg.py +++ b/tests/test_neg.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.neg(inputs) - return x + return paddle.neg(inputs) def test_neg_9(): diff --git a/tests/test_nn_AdaptiveAvgPool1D.py b/tests/test_nn_AdaptiveAvgPool1D.py index 0c684179c..4de71ebcb 100755 --- a/tests/test_nn_AdaptiveAvgPool1D.py +++ b/tests/test_nn_AdaptiveAvgPool1D.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._avg_pool = paddle.nn.AdaptiveAvgPool1D(output_size=3) def forward(self, inputs): """ forward """ - x = self._avg_pool(inputs) - return x + return self._avg_pool(inputs) def test_AdaptiveAvgPool1D_base(): diff --git a/tests/test_nn_AdaptiveAvgPool2D.py b/tests/test_nn_AdaptiveAvgPool2D.py index a849d6321..72782981f 100755 --- a/tests/test_nn_AdaptiveAvgPool2D.py +++ b/tests/test_nn_AdaptiveAvgPool2D.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._avg_pool = paddle.nn.AdaptiveAvgPool2D(output_size=3) def forward(self, inputs): """ forward """ - x = self._avg_pool(inputs) - return x + return self._avg_pool(inputs) @_test_with_pir diff --git a/tests/test_nn_AdaptiveAvgPool3D.py b/tests/test_nn_AdaptiveAvgPool3D.py index 6756aa0ad..6045b65f5 100755 --- a/tests/test_nn_AdaptiveAvgPool3D.py +++ b/tests/test_nn_AdaptiveAvgPool3D.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._avg_pool = paddle.nn.AdaptiveAvgPool3D(output_size=3) def forward(self, inputs): """ forward """ - x = self._avg_pool(inputs) - return x + return self._avg_pool(inputs) def test_AdaptiveAvgPool3D_base(): diff --git a/tests/test_nn_BatchNorm2D.py b/tests/test_nn_BatchNorm2D.py index 8f6ddc79d..ee63039da 100644 --- a/tests/test_nn_BatchNorm2D.py +++ b/tests/test_nn_BatchNorm2D.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._bn = paddle.nn.BatchNorm2D(num_features=1) def forward(self, inputs): """ forward """ - x = self._bn(inputs) - return x + return self._bn(inputs) @_test_with_pir diff --git a/tests/test_nn_Conv1D.py b/tests/test_nn_Conv1D.py index 0934edaf8..4ee6140c0 100644 --- a/tests/test_nn_Conv1D.py +++ b/tests/test_nn_Conv1D.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -37,7 +36,7 @@ def __init__( bias_attr=None, data_format="NCL", ): - super(Net, self).__init__() + super().__init__() self._conv1d = paddle.nn.Conv1D( in_channels=in_channels, out_channels=out_channels, @@ -56,8 +55,7 @@ def forward(self, inputs): """ forward """ - x = self._conv1d(inputs) - return x + return self._conv1d(inputs) @_test_with_pir diff --git a/tests/test_nn_Conv1DTranspose.py b/tests/test_nn_Conv1DTranspose.py index 78a8cb293..df7c5d312 100644 --- a/tests/test_nn_Conv1DTranspose.py +++ b/tests/test_nn_Conv1DTranspose.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -37,7 +36,7 @@ def __init__( bias_attr=None, data_format="NCL", ): - super(Net, self).__init__() + super().__init__() self._conv2d_t = paddle.nn.Conv1DTranspose( in_channels=in_channels, out_channels=out_channels, @@ -56,8 +55,7 @@ def forward(self, inputs): """ forward """ - x = self._conv2d_t(inputs) - return x + return self._conv2d_t(inputs) @_test_with_pir diff --git a/tests/test_nn_Conv2D.py b/tests/test_nn_Conv2D.py index d872fe663..7f93dab4a 100755 --- a/tests/test_nn_Conv2D.py +++ b/tests/test_nn_Conv2D.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -36,7 +35,7 @@ def __init__( bias_attr=None, data_format="NCHW", ): - super(Net, self).__init__() + super().__init__() self.conv2d = paddle.nn.Conv2D( in_channels=in_channels, out_channels=out_channels, @@ -55,8 +54,7 @@ def forward(self, inputs): """ forward """ - x = self.conv2d(inputs) - return x + return self.conv2d(inputs) @_test_with_pir diff --git a/tests/test_nn_Conv2DTranspose.py b/tests/test_nn_Conv2DTranspose.py index 36c073687..b928f1b54 100644 --- a/tests/test_nn_Conv2DTranspose.py +++ b/tests/test_nn_Conv2DTranspose.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -36,7 +35,7 @@ def __init__( bias_attr=None, data_format="NCHW", ): - super(Net, self).__init__() + super().__init__() self._conv2d_t = paddle.nn.Conv2DTranspose( in_channels=in_channels, out_channels=out_channels, @@ -55,8 +54,7 @@ def forward(self, inputs): """ forward """ - x = self._conv2d_t(inputs) - return x + return self._conv2d_t(inputs) @_test_with_pir diff --git a/tests/test_nn_Conv3D.py b/tests/test_nn_Conv3D.py index 4d3d570ba..17e691dd6 100755 --- a/tests/test_nn_Conv3D.py +++ b/tests/test_nn_Conv3D.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -36,7 +35,7 @@ def __init__( bias_attr=None, data_format="NCDHW", ): - super(Net, self).__init__() + super().__init__() self.conv3d = paddle.nn.Conv3D( in_channels=in_channels, out_channels=out_channels, @@ -55,8 +54,7 @@ def forward(self, inputs): """ forward """ - x = self.conv3d(inputs) - return x + return self.conv3d(inputs) @_test_with_pir diff --git a/tests/test_nn_Conv3DTranspose.py b/tests/test_nn_Conv3DTranspose.py index 38a04d946..90a065124 100755 --- a/tests/test_nn_Conv3DTranspose.py +++ b/tests/test_nn_Conv3DTranspose.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -34,7 +35,7 @@ def __init__( bias_attr=None, data_format="NCDHW", ): - super(Net, self).__init__() + super().__init__() self.conv3dTranspose = paddle.nn.Conv3DTranspose( in_channels=in_channels, out_channels=out_channels, @@ -53,8 +54,7 @@ def forward(self, inputs): """ forward """ - x = self.conv3dTranspose(inputs) - return x + return self.conv3dTranspose(inputs) @_test_with_pir diff --git a/tests/test_nn_ELU.py b/tests/test_nn_ELU.py index f264c2180..08a2f21ae 100644 --- a/tests/test_nn_ELU.py +++ b/tests/test_nn_ELU.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._elu = paddle.nn.ELU(alpha=1.0) def forward(self, inputs): """ forward """ - x = self._elu(inputs) - return x + return self._elu(inputs) def test_ELU_9(): diff --git a/tests/test_nn_Embedding.py b/tests/test_nn_Embedding.py index 05614a8d6..5dbdb55f2 100644 --- a/tests/test_nn_Embedding.py +++ b/tests/test_nn_Embedding.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir import numpy as np +from onnxbase import APIOnnx, _test_with_pir + +import paddle class Net(paddle.nn.Layer): @@ -24,7 +24,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._embedding = paddle.nn.Embedding( num_embeddings=10, embedding_dim=3, @@ -38,8 +38,7 @@ def forward(self, inputs): """ forward """ - x = self._embedding(inputs) - return x + return self._embedding(inputs) @_test_with_pir diff --git a/tests/test_nn_Functional_LogSoftmax.py b/tests/test_nn_Functional_LogSoftmax.py index 4913f35cf..ca8e9b168 100644 --- a/tests/test_nn_Functional_LogSoftmax.py +++ b/tests/test_nn_Functional_LogSoftmax.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle import paddle.nn as nn -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -24,7 +24,7 @@ class Net(paddle.nn.Layer): """ def __init__(self, axis=-1, dtype=None): - super(Net, self).__init__() + super().__init__() self.axis = axis self.dtype = dtype @@ -32,8 +32,7 @@ def forward(self, inputs): """ forward """ - x = nn.functional.log_softmax(inputs, axis=self.axis, dtype=self.dtype) - return x + return nn.functional.log_softmax(inputs, axis=self.axis, dtype=self.dtype) def test_nn_functional_LogSigmoid_9(): diff --git a/tests/test_nn_Functional_interpolate.py b/tests/test_nn_Functional_interpolate.py index 0cb57635f..51fdccd2d 100644 --- a/tests/test_nn_Functional_interpolate.py +++ b/tests/test_nn_Functional_interpolate.py @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir, randtool + import paddle import paddle.nn as nn -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_only_pir class Net(paddle.nn.Layer): @@ -33,7 +32,7 @@ def __init__( align_mode=0, data_format="NCHW", ): - super(Net, self).__init__() + super().__init__() self.size = size self.scale_factor = scale_factor self.mode = mode @@ -45,7 +44,7 @@ def forward(self, inputs): """ forward """ - x = nn.functional.interpolate( + return nn.functional.interpolate( x=inputs, size=self.size, scale_factor=self.scale_factor, @@ -54,7 +53,6 @@ def forward(self, inputs): align_mode=self.align_mode, data_format=self.data_format, ) - return x @_test_only_pir diff --git a/tests/test_nn_Functional_softsign.py b/tests/test_nn_Functional_softsign.py index 09bc56eac..71d5b3f8b 100644 --- a/tests/test_nn_Functional_softsign.py +++ b/tests/test_nn_Functional_softsign.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.softsign(inputs) - return x + return paddle.nn.functional.softsign(inputs) def test_softsign_9(): diff --git a/tests/test_nn_Functional_thresholded.py b/tests/test_nn_Functional_thresholded.py index c8c945824..3797ca4cb 100644 --- a/tests/test_nn_Functional_thresholded.py +++ b/tests/test_nn_Functional_thresholded.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle import paddle.nn as nn -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -24,15 +24,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, threshold=1): - super(Net, self).__init__() + super().__init__() self.threshold = threshold def forward(self, inputs): """ forward """ - x = nn.functional.thresholded_relu(inputs, threshold=self.threshold) - return x + return nn.functional.thresholded_relu(inputs, threshold=self.threshold) def test_nn_functional_thresholded_relu_10(): diff --git a/tests/test_nn_GRU.py b/tests/test_nn_GRU.py index 5f668ecab..e363bdc1b 100644 --- a/tests/test_nn_GRU.py +++ b/tests/test_nn_GRU.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx, _test_with_pir +import paddle + class Net(paddle.nn.Layer): """ @@ -22,14 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._gru = paddle.nn.GRU(16, 32, 2) def forward(self, inputs, inputs_): """ forward """ - x, h = self._gru(inputs, inputs_) + x, _h = self._gru(inputs, inputs_) return x diff --git a/tests/test_nn_GroupNorm.py b/tests/test_nn_GroupNorm.py index 6e0c80215..c413ce426 100644 --- a/tests/test_nn_GroupNorm.py +++ b/tests/test_nn_GroupNorm.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -22,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._group_norm = paddle.nn.GroupNorm(num_groups=5, num_channels=10) def forward(self, inputs): """ forward """ - x = self._group_norm(inputs) - return x + return self._group_norm(inputs) @_test_with_pir diff --git a/tests/test_nn_Hardshrink.py b/tests/test_nn_Hardshrink.py index 060370c91..2385b73b6 100644 --- a/tests/test_nn_Hardshrink.py +++ b/tests/test_nn_Hardshrink.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._hardshrink = paddle.nn.Hardshrink() def forward(self, inputs): """ forward """ - x = self._hardshrink(inputs) - return x + return self._hardshrink(inputs) def test_hardshrink_9(): diff --git a/tests/test_nn_Hardsigmoid.py b/tests/test_nn_Hardsigmoid.py index d9a9764d3..f645851ec 100644 --- a/tests/test_nn_Hardsigmoid.py +++ b/tests/test_nn_Hardsigmoid.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._hard_sigmoid = paddle.nn.Hardsigmoid() def forward(self, inputs): """ forward """ - x = self._hard_sigmoid(inputs) - return x + return self._hard_sigmoid(inputs) def test_Hardsigmoid_9(): diff --git a/tests/test_nn_InstanceNorm3D.py b/tests/test_nn_InstanceNorm3D.py index 3f9f6c1d2..da71393a9 100644 --- a/tests/test_nn_InstanceNorm3D.py +++ b/tests/test_nn_InstanceNorm3D.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -22,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._instance_norm = paddle.nn.InstanceNorm3D( num_features=2, epsilon=1e-05, @@ -37,8 +38,7 @@ def forward(self, inputs): """ forward """ - x = self._instance_norm(inputs) - return x + return self._instance_norm(inputs) @_test_with_pir diff --git a/tests/test_nn_LayerNorm.py b/tests/test_nn_LayerNorm.py index 873a79c87..bc45a159d 100644 --- a/tests/test_nn_LayerNorm.py +++ b/tests/test_nn_LayerNorm.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._layer_norm = paddle.nn.LayerNorm(normalized_shape=[1, 10, 10]) def forward(self, inputs): """ forward """ - x = self._layer_norm(inputs) - return x + return self._layer_norm(inputs) @_test_with_pir diff --git a/tests/test_nn_LeakyReLU.py b/tests/test_nn_LeakyReLU.py index 0ada2df8d..d045abff4 100644 --- a/tests/test_nn_LeakyReLU.py +++ b/tests/test_nn_LeakyReLU.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._leaky_relu = paddle.nn.LeakyReLU(negative_slope=0.01, name=None) def forward(self, inputs): """ forward """ - x = self._leaky_relu(inputs) - return x + return self._leaky_relu(inputs) def test_LeakyReLU_base(): diff --git a/tests/test_nn_LogSigmoid.py b/tests/test_nn_LogSigmoid.py index 2826b1365..a7fea1041 100644 --- a/tests/test_nn_LogSigmoid.py +++ b/tests/test_nn_LogSigmoid.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._Log_Sigmoid = paddle.nn.LogSigmoid() def forward(self, inputs): """ forward """ - x = self._Log_Sigmoid(inputs) - return x + return self._Log_Sigmoid(inputs) def test_nn_LogSigmoid_9(): diff --git a/tests/test_nn_MaxPool1D.py b/tests/test_nn_MaxPool1D.py index dcb6c0b70..f5f0882e2 100644 --- a/tests/test_nn_MaxPool1D.py +++ b/tests/test_nn_MaxPool1D.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._max_pool = paddle.nn.MaxPool1D( kernel_size=2, stride=None, @@ -37,8 +37,7 @@ def forward(self, inputs): """ forward """ - x = self._max_pool(inputs) - return x + return self._max_pool(inputs) def test_MaxPool1D_base(): diff --git a/tests/test_nn_MaxPool2D.py b/tests/test_nn_MaxPool2D.py index 1fab4e980..402a25e3d 100644 --- a/tests/test_nn_MaxPool2D.py +++ b/tests/test_nn_MaxPool2D.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -33,7 +32,7 @@ def __init__( data_format="NCHW", name=None, ): - super(Net, self).__init__() + super().__init__() self._max_pool = paddle.nn.MaxPool2D( kernel_size=kernel_size, stride=stride, @@ -48,8 +47,7 @@ def forward(self, inputs): """ forward """ - x = self._max_pool(inputs) - return x + return self._max_pool(inputs) @_test_with_pir diff --git a/tests/test_nn_MaxPool3D.py b/tests/test_nn_MaxPool3D.py index c87259404..fe10efda2 100755 --- a/tests/test_nn_MaxPool3D.py +++ b/tests/test_nn_MaxPool3D.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._max_pool = paddle.nn.MaxPool3D( kernel_size=2, stride=None, @@ -38,8 +38,7 @@ def forward(self, inputs): """ forward """ - x = self._max_pool(inputs) - return x + return self._max_pool(inputs) def test_MaxPool3D_base(): diff --git a/tests/test_nn_Pad1D.py b/tests/test_nn_Pad1D.py index afc19ad8c..dbb87d4ca 100644 --- a/tests/test_nn_Pad1D.py +++ b/tests/test_nn_Pad1D.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self, mode="constant", padding=1): - super(Net, self).__init__() + super().__init__() self.mode = mode self.padding = padding self._pad = paddle.nn.Pad1D(padding=self.padding, mode=self.mode) @@ -32,8 +32,7 @@ def forward(self, inputs): """ forward """ - x = self._pad(inputs) - return x + return self._pad(inputs) def test_Pad1D_9(): diff --git a/tests/test_nn_Pad2D.py b/tests/test_nn_Pad2D.py index c2070cbe7..8e72f6e3a 100644 --- a/tests/test_nn_Pad2D.py +++ b/tests/test_nn_Pad2D.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._bn = paddle.nn.Pad2D(padding=1, mode="constant") def forward(self, inputs): """ forward """ - x = self._bn(inputs) - return x + return self._bn(inputs) def test_Pad2D_9(): diff --git a/tests/test_nn_Pad3D.py b/tests/test_nn_Pad3D.py index 60fa7d3bc..b45d158fd 100644 --- a/tests/test_nn_Pad3D.py +++ b/tests/test_nn_Pad3D.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._pad = paddle.nn.Pad3D(padding=1, mode="constant") def forward(self, inputs): """ forward """ - x = self._pad(inputs) - return x + return self._pad(inputs) @_test_with_pir @@ -116,15 +115,14 @@ class Net2(paddle.nn.Layer): """ def __init__(self): - super(Net2, self).__init__() + super().__init__() self._pad = paddle.nn.Pad3D(padding=1, mode="circular") def forward(self, inputs): """ forward """ - x = self._pad(inputs) - return x + return self._pad(inputs) @_test_with_pir diff --git a/tests/test_nn_PixelShuffle.py b/tests/test_nn_PixelShuffle.py index e46962183..f0536dc2f 100644 --- a/tests/test_nn_PixelShuffle.py +++ b/tests/test_nn_PixelShuffle.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx +import paddle + class Net(paddle.nn.Layer): """ @@ -22,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self.shuffle = paddle.nn.PixelShuffle( upscale_factor=3, data_format="NCHW", name=None ) @@ -31,8 +32,7 @@ def forward(self, inputs): """ forward """ - x = self.shuffle(inputs) - return x + return self.shuffle(inputs) def test_PixelShuffle_base(): diff --git a/tests/test_nn_Softmax.py b/tests/test_nn_Softmax.py index 231e03997..223450b03 100644 --- a/tests/test_nn_Softmax.py +++ b/tests/test_nn_Softmax.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._softmax = paddle.nn.Softmax(axis=-1, name=None) def forward(self, inputs): """ forward """ - x = self._softmax(inputs) - return x + return self._softmax(inputs) def test_Softmax_9(): diff --git a/tests/test_nn_TanhShrink.py b/tests/test_nn_TanhShrink.py index d556c4956..9b4c51c5e 100644 --- a/tests/test_nn_TanhShrink.py +++ b/tests/test_nn_TanhShrink.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self._tanhshrink = paddle.nn.Tanhshrink() def forward(self, inputs): """ forward """ - x = self._tanhshrink(inputs) - return x + return self._tanhshrink(inputs) def test_nn_tanhshrink_9(): diff --git a/tests/test_nn_Upsample.py b/tests/test_nn_Upsample.py index f21d87452..87231d477 100755 --- a/tests/test_nn_Upsample.py +++ b/tests/test_nn_Upsample.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -30,7 +31,7 @@ def __init__( align_mode=0, data_format="NCHW", ): - super(Net, self).__init__() + super().__init__() self.size = size self.scale_factor = scale_factor self.mode = mode @@ -42,7 +43,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.upsample( + return paddle.nn.functional.upsample( x=inputs, size=self.size, scale_factor=self.scale_factor, @@ -51,7 +52,6 @@ def forward(self, inputs): align_mode=self.align_mode, data_format=self.data_format, ) - return x @_test_with_pir diff --git a/tests/test_nn_initializer_Uniform.py b/tests/test_nn_initializer_Uniform.py index 66a7080c3..caf69bd3d 100644 --- a/tests/test_nn_initializer_Uniform.py +++ b/tests/test_nn_initializer_Uniform.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self.weight_attr = paddle.framework.ParamAttr( name="linear_weight", initializer=paddle.nn.initializer.Uniform(low=-0.5, high=0.5), @@ -41,8 +40,7 @@ def forward(self, inputs): """ forward """ - x = self._linear(inputs) - return x + return self._linear(inputs) @_test_with_pir diff --git a/tests/test_nonzero.py b/tests/test_nonzero.py index c4c3bd087..c6bb63074 100644 --- a/tests/test_nonzero.py +++ b/tests/test_nonzero.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nonzero(inputs, as_tuple=False) - return x + return paddle.nonzero(inputs, as_tuple=False) @_test_with_pir diff --git a/tests/test_normalize.py b/tests/test_normalize.py index 97efe33fe..ca5a057c2 100644 --- a/tests/test_normalize.py +++ b/tests/test_normalize.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx, randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -22,16 +23,15 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.normalize( + return paddle.nn.functional.normalize( inputs, p=2, axis=1, epsilon=1e-12, name=None ) - return x @_test_with_pir diff --git a/tests/test_numel.py b/tests/test_numel.py index 589e197ff..f9a31281b 100644 --- a/tests/test_numel.py +++ b/tests/test_numel.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.numel(inputs) - return x + return paddle.numel(inputs) @_test_with_pir diff --git a/tests/test_pow.py b/tests/test_pow.py index ce09250b1..dd964e8c2 100644 --- a/tests/test_pow.py +++ b/tests/test_pow.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.pow(inputs, 2) - return x + return paddle.pow(inputs, 2) @_test_with_pir diff --git a/tests/test_prelu.py b/tests/test_prelu.py index c2fa420d1..a047277fd 100644 --- a/tests/test_prelu.py +++ b/tests/test_prelu.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_only_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.prelu(inputs, paddle.to_tensor([0.25])) - return x + return paddle.nn.functional.prelu(inputs, paddle.to_tensor([0.25])) @_test_only_pir diff --git a/tests/test_quantize_linear.py b/tests/test_quantize_linear.py index cc2b53736..1c9a6727e 100755 --- a/tests/test_quantize_linear.py +++ b/tests/test_quantize_linear.py @@ -13,14 +13,16 @@ # limitations under the License. import os -import paddle -import numpy as np -import paddle2onnx import unittest + +import numpy as np import onnxruntime as ort -from paddle.base import unique_name from onnxbase import _test_only_pir +import paddle +import paddle2onnx +from paddle.base import unique_name + def convert_scale_to_paddle(onnx_scale, qmax): return onnx_scale * qmax @@ -49,7 +51,7 @@ def build_static_net(input_shape, quant_axis, scale_shape, qmin, qmax, type): initializer=paddle.nn.initializer.Constant(0.0), stop_gradient=True, ) - quant_out, out_state, out_accum, out_scale = paddle._C_ops.quantize_linear( + quant_out, _out_state, _out_accum, _out_scale = paddle._C_ops.quantize_linear( x, scale, zero_points, diff --git a/tests/test_quantize_model.py b/tests/test_quantize_model.py index 84fa4b2dd..807442e94 100755 --- a/tests/test_quantize_model.py +++ b/tests/test_quantize_model.py @@ -11,19 +11,21 @@ # 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. -import unittest +import functools import os -import time -import sys +import platform import random -import functools +import sys +import time +import unittest + import numpy as np -from paddle.static.io import load_inference_model from PIL import Image + import paddle from paddle.dataset.common import download +from paddle.static.io import load_inference_model from paddle.static.quantization import PostTrainingQuantization -import platform if platform.system() == "Windows": os.system("set no_proxy=bcebos.com") @@ -46,10 +48,9 @@ def resize_short(img, target_size): percent = float(target_size) / min(img.size[0], img.size[1]) - resized_width = int(round(img.size[0] * percent)) - resized_height = int(round(img.size[1] * percent)) - img = img.resize((resized_width, resized_height), Image.LANCZOS) - return img + resized_width = round(img.size[0] * percent) + resized_height = round(img.size[1] * percent) + return img.resize((resized_width, resized_height), Image.LANCZOS) def crop_image(img, target_size, center): @@ -63,8 +64,7 @@ def crop_image(img, target_size, center): h_start = np.random.randint(0, height - size + 1) w_end = w_start + size h_end = h_start + size - img = img.crop((w_start, h_start, w_end, h_end)) - return img + return img.crop((w_start, h_start, w_end, h_end)) def process_image(sample, mode, color_jitter, rotate): @@ -155,7 +155,7 @@ def tearDown(self): def cache_unzipping(self, target_folder, zip_path): if not os.path.exists(target_folder): - cmd = "mkdir {0} && tar xf {1} -C {0}".format(target_folder, zip_path) + cmd = f"mkdir {target_folder} && tar xf {zip_path} -C {target_folder}" os.system(cmd) def download_data(self, data_urls, data_md5s, folder_name, is_model=True): @@ -163,7 +163,7 @@ def download_data(self, data_urls, data_md5s, folder_name, is_model=True): zip_path = "" if os.environ.get("DATASET") == "full": file_names = [] - for i in range(0, len(data_urls)): + for i in range(len(data_urls)): download(data_urls[i], self.int8_download, data_md5s[i]) file_names.append(data_urls[i].split("/")[-1]) @@ -180,7 +180,7 @@ def download_data(self, data_urls, data_md5s, folder_name, is_model=True): file_name = data_urls[0].split("/")[-1] zip_path = os.path.join(self.cache_folder, file_name) - print("Data is downloaded at {0}".format(zip_path)) + print(f"Data is downloaded at {zip_path}") self.cache_unzipping(data_cache_folder, zip_path) return data_cache_folder @@ -205,6 +205,7 @@ def run_program( sess = None if run_onnxruntime: import onnxruntime as rt + import paddle2onnx onnx_model = paddle2onnx.command.c_paddle_to_onnx( @@ -266,12 +267,12 @@ def run_program( cnt += len(data) if (batch_id + 1) % 100 == 0: - print("{0} images,".format(batch_id + 1)) + print(f"{batch_id + 1} images,") sys.stdout.flush() if (batch_id + 1) == iterations: break result = np.mean(np.array(results), axis=0) - print("top1_acc = {}".format(result)) + print(f"top1_acc = {result}") throughput = cnt / np.sum(periods) latency = np.average(periods) acc1 = result @@ -292,7 +293,7 @@ def generate_quantized_model( try: os.system("mkdir " + self.int8_model) except Exception as e: - print("Failed to create {} due to {}".format(self.int8_model, str(e))) + print(f"Failed to create {self.int8_model} due to {e!s}") sys.exit(-1) place = paddle.CPUPlace() @@ -337,9 +338,7 @@ def run_test( model_cache_folder = os.path.join(self.cache_folder, model) print( - "Start FP32 inference for {0} on {1} images ...".format( - model, infer_iterations * batch_size - ) + f"Start FP32 inference for {model} on {infer_iterations * batch_size} images ..." ) (fp32_throughput, fp32_latency, fp32_acc1) = self.run_program( model_cache_folder, @@ -350,9 +349,7 @@ def run_test( ) print( - "Start INT8 post training quantization for {0} on {1} images ...".format( - model, sample_iterations * batch_size - ) + f"Start INT8 post training quantization for {model} on {sample_iterations * batch_size} images ..." ) self.generate_quantized_model( model_cache_folder, @@ -367,9 +364,7 @@ def run_test( ) print( - "Start INT8 inference for {0} on {1} images ...".format( - model, infer_iterations * batch_size - ) + f"Start INT8 inference for {model} on {infer_iterations * batch_size} images ..." ) (int8_throughput, int8_latency, int8_acc1) = self.run_program( self.int8_model, @@ -380,9 +375,7 @@ def run_test( ) print( - "Start use ONNXRuntime inference for {0} on {1} images ...".format( - model, infer_iterations * batch_size - ) + f"Start use ONNXRuntime inference for {model} on {infer_iterations * batch_size} images ..." ) (onnx_int8_throughput, onnx_int8_latency, onnx_int8_acc1) = self.run_program( self.int8_model, @@ -393,25 +386,15 @@ def run_test( run_onnxruntime=True, ) - print("---Post training quantization of {} method---".format(algo)) + print(f"---Post training quantization of {algo} method---") print( - "FP32 {0}: batch_size {1}, throughput {2} images/second, latency {3} second, accuracy {4}.".format( - model, batch_size, fp32_throughput, fp32_latency, fp32_acc1 - ) + f"FP32 {model}: batch_size {batch_size}, throughput {fp32_throughput} images/second, latency {fp32_latency} second, accuracy {fp32_acc1}." ) print( - "INT8 {0}: batch_size {1}, throughput {2} images/second, latency {3} second, accuracy {4}.".format( - model, batch_size, int8_throughput, int8_latency, int8_acc1 - ) + f"INT8 {model}: batch_size {batch_size}, throughput {int8_throughput} images/second, latency {int8_latency} second, accuracy {int8_acc1}." ) print( - "ONNXRuntime INT8 {0}: batch_size {1}, throughput {2} images/second, latency {3} second, accuracy {4}.\n".format( - model, - batch_size, - onnx_int8_throughput, - onnx_int8_latency, - onnx_int8_acc1, - ) + f"ONNXRuntime INT8 {model}: batch_size {batch_size}, throughput {onnx_int8_throughput} images/second, latency {onnx_int8_latency} second, accuracy {onnx_int8_acc1}.\n" ) sys.stdout.flush() diff --git a/tests/test_quantize_model_minist.py b/tests/test_quantize_model_minist.py index 160035b9c..f6afdb90c 100755 --- a/tests/test_quantize_model_minist.py +++ b/tests/test_quantize_model_minist.py @@ -11,14 +11,14 @@ # 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. -import unittest import os -import time -import sys import random +import sys +import time +import unittest + import numpy as np import paddle -import paddle.fluid as fluid from paddle.static.quantization import PostTrainingQuantization paddle.enable_static() @@ -37,31 +37,29 @@ def setUp(self): try: os.system("mkdir -p " + self.int8_model_path) except Exception as e: - print("Failed to create {} due to {}".format(self.int8_model_path, str(e))) + print(f"Failed to create {self.int8_model_path} due to {e!s}") sys.exit(-1) def tearDown(self): pass def merge_params(self, input_model_path, output_model_path): - import paddle.fluid as fluid - import paddle - - paddle.enable_static() model_dir = input_model_path new_model_dir = output_model_path - exe = fluid.Executor(fluid.CPUPlace()) + exe = paddle.static.Executor(paddle.CPUPlace()) [inference_program, feed_target_names, fetch_targets] = ( - fluid.io.load_inference_model(dirname=model_dir, executor=exe) + paddle.static.load_inference_model(path_prefix=model_dir, executor=exe) ) - fluid.io.save_inference_model( - dirname=new_model_dir, - feeded_var_names=feed_target_names, - target_vars=fetch_targets, + feed_vars = [ + inference_program.global_block().var(name) for name in feed_target_names + ] + paddle.static.save_inference_model( + path_prefix=os.path.join(new_model_dir, "__model__"), + feed_vars=feed_vars, + fetch_vars=fetch_targets, executor=exe, - main_program=inference_program, - params_filename="__params__", + program=inference_program, ) def run_program( @@ -73,8 +71,8 @@ def run_program( params_filename="", use_onnxruntime=False, ): - place = fluid.CPUPlace() - exe = fluid.Executor(place) + place = paddle.CPUPlace() + exe = paddle.static.Executor(place) infer_program = None feed_dict = None @@ -83,6 +81,7 @@ def run_program( sess = None if use_onnxruntime: import onnxruntime as rt + import paddle2onnx new_model_path = model_path @@ -112,11 +111,14 @@ def run_program( self.merge_params(model_path, new_model_path) model_filename = "__model__" params_filename = "__params__" - [infer_program, feed_dict, fetch_targets] = fluid.io.load_inference_model( - new_model_path, - exe, - model_filename=model_filename, - params_filename=params_filename, + model_prefix = os.path.join( + new_model_path, model_filename.replace(".pdmodel", "") + ) + [infer_program, feed_dict, fetch_targets] = ( + paddle.static.load_inference_model( + path_prefix=model_prefix, + executor=exe, + ) ) val_reader = paddle.batch(paddle.dataset.mnist.test(), batch_size) @@ -157,7 +159,7 @@ def generate_quantized_model( self, model_path, algo="KL", - quantizable_op_type=["conv2d"], + quantizable_op_type=None, is_full_quantize=False, is_use_cache_file=False, is_optimize_model=False, @@ -166,9 +168,10 @@ def generate_quantized_model( onnx_format=False, skip_tensor_list=None, ): - - place = fluid.CPUPlace() - exe = fluid.Executor(place) + if quantizable_op_type is None: + quantizable_op_type = ["conv2d"] + place = paddle.CPUPlace() + exe = paddle.static.Executor(place) val_reader = paddle.dataset.mnist.train() new_model_path = model_path + "_conbined" self.merge_params(model_path, new_model_path) @@ -213,27 +216,21 @@ def run_test( origin_model_path = os.path.join(self.cache_folder, model_name) print( - "Start FP32 inference for {0} on {1} images ...".format( - model_name, infer_iterations * batch_size - ) + f"Start FP32 inference for {model_name} on {infer_iterations * batch_size} images ..." ) (fp32_throughput, fp32_latency, fp32_acc1) = self.run_program( origin_model_path, batch_size, infer_iterations ) print( - "Start FP32 inference on onnxruntime for {0} on {1} images ...".format( - model_name, infer_iterations * batch_size - ) + f"Start FP32 inference on onnxruntime for {model_name} on {infer_iterations * batch_size} images ..." ) (onnx_fp32_throughput, onnx_fp32_latency, onnx_fp32_acc1) = self.run_program( origin_model_path, batch_size, infer_iterations, use_onnxruntime=True ) print( - "Start INT8 post training quantization for {0} on {1} images ...".format( - model_name, quant_iterations * batch_size - ) + f"Start INT8 post training quantization for {model_name} on {quant_iterations * batch_size} images ..." ) self.generate_quantized_model( origin_model_path, @@ -249,9 +246,7 @@ def run_test( ) print( - "Start INT8 inference for {0} on {1} images ...".format( - model_name, infer_iterations * batch_size - ) + f"Start INT8 inference for {model_name} on {infer_iterations * batch_size} images ..." ) (int8_throughput, int8_latency, int8_acc1) = self.run_program( self.int8_model_path, @@ -262,9 +257,7 @@ def run_test( ) print( - "Start INT8 inference on onnxruntime for {0} on {1} images ...".format( - model_name, infer_iterations * batch_size - ) + f"Start INT8 inference on onnxruntime for {model_name} on {infer_iterations * batch_size} images ..." ) (onnx_int8_throughput, onnx_int8_latency, onnx_int8_acc1) = self.run_program( self.int8_model_path, @@ -275,34 +268,18 @@ def run_test( use_onnxruntime=True, ) - print("---Post training quantization of {} method---".format(algo)) + print(f"---Post training quantization of {algo} method---") print( - "FP32 {0}: batch_size {1}, throughput {2} img/s, latency {3} s, acc1 {4}.".format( - model_name, batch_size, fp32_throughput, fp32_latency, fp32_acc1 - ) + f"FP32 {model_name}: batch_size {batch_size}, throughput {fp32_throughput} img/s, latency {fp32_latency} s, acc1 {fp32_acc1}." ) print( - "ONNXRuntime FP32 {0}: batch_size {1}, throughput {2} img/s, latency {3} s, acc1 {4}.".format( - model_name, - batch_size, - onnx_fp32_throughput, - onnx_fp32_latency, - onnx_fp32_acc1, - ) + f"ONNXRuntime FP32 {model_name}: batch_size {batch_size}, throughput {onnx_fp32_throughput} img/s, latency {onnx_fp32_latency} s, acc1 {onnx_fp32_acc1}." ) print( - "INT8 {0}: batch_size {1}, throughput {2} img/s, latency {3} s, acc1 {4}.\n".format( - model_name, batch_size, int8_throughput, int8_latency, int8_acc1 - ) + f"INT8 {model_name}: batch_size {batch_size}, throughput {int8_throughput} img/s, latency {int8_latency} s, acc1 {int8_acc1}.\n" ) print( - "ONNXRuntime INT8 {0}: batch_size {1}, throughput {2} img/s, latency {3} s, acc1 {4}.\n".format( - model_name, - batch_size, - onnx_int8_throughput, - onnx_int8_latency, - onnx_int8_acc1, - ) + f"ONNXRuntime INT8 {model_name}: batch_size {batch_size}, throughput {onnx_int8_throughput} img/s, latency {onnx_int8_latency} s, acc1 {onnx_int8_acc1}.\n" ) sys.stdout.flush() diff --git a/tests/test_quantize_model_speedup.py b/tests/test_quantize_model_speedup.py index bcca64c73..020bbd0ca 100755 --- a/tests/test_quantize_model_speedup.py +++ b/tests/test_quantize_model_speedup.py @@ -11,14 +11,15 @@ # 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. -import unittest import os -import time -import sys import random +import sys +import time +import unittest + import numpy as np import paddle -from fake_quant import post_quant_fake +from fake_quant import _HAS_IR_GRAPH, post_quant_fake paddle.enable_static() @@ -40,6 +41,7 @@ def run_program( ): print("test model path:" + model_path) import onnxruntime as rt + import paddle2onnx onnx_model = paddle2onnx.command.c_paddle_to_onnx( @@ -78,8 +80,7 @@ def run_program( period = t2 - t1 periods.append(period) - latency = np.average(periods) - return latency + return np.average(periods) def generate_quantized_model( self, @@ -111,12 +112,12 @@ def run_test( self.model_name = model_name origin_model_path = os.path.join(self.quantize_model_dir, model_name) - print("Start FP32 inference for {0} ...".format(model_name)) + print(f"Start FP32 inference for {model_name} ...") fp32_latency = self.run_program( origin_model_path, model_filename, params_filename, threads_num ) - print("Start INT8 post training quantization for {0} ...".format(model_name)) + print(f"Start INT8 post training quantization for {model_name} ...") quantize_model_path = os.path.join( self.quantize_model_dir, model_name + "_quantized" ) @@ -124,7 +125,7 @@ def run_test( origin_model_path, quantize_model_path, model_filename, params_filename ) - print("Start INT8 inference for {0} ...".format(model_name)) + print(f"Start INT8 inference for {model_name} ...") if ".pdmodel" in model_filename: int8_latency = self.run_program( quantize_model_path, model_filename, params_filename, threads_num @@ -138,38 +139,58 @@ def run_test( ) print("---Post training quantization---") - print("FP32 lentency {0}: latency {1} s.".format(model_name, fp32_latency)) - print("INT8 {0}: latency {1} s.\n".format(model_name, int8_latency)) + print(f"FP32 lentency {model_name}: latency {fp32_latency} s.") + print(f"INT8 {model_name}: latency {int8_latency} s.\n") sys.stdout.flush() latency_diff = int8_latency - fp32_latency self.assertLess(latency_diff, -0.1) +@unittest.skipUnless( + _HAS_IR_GRAPH, + "Requires paddle.fluid.framework.IrGraph, removed in PaddlePaddle 3.x", +) class TestPostTrainingE2eqONNXFormatFullQuant(TestPostTrainingQuantization): def test_post_training_e2eq_onnx_format_full_quant(self): model_name = "e2eq" self.run_test(model_name, threads_num=1) +@unittest.skipUnless( + _HAS_IR_GRAPH, + "Requires paddle.fluid.framework.IrGraph, removed in PaddlePaddle 3.x", +) class TestPostTrainingFeedasqONNXFormatFullQuant(TestPostTrainingQuantization): def test_post_training_feedasq_onnx_format_full_quant(self): model_name = "feedasq" self.run_test(model_name, threads_num=1) +@unittest.skipUnless( + _HAS_IR_GRAPH, + "Requires paddle.fluid.framework.IrGraph, removed in PaddlePaddle 3.x", +) class TestPostTrainingFeedasqNohadamaONNXFormatFullQuant(TestPostTrainingQuantization): def test_post_training_feedasq_nohadama_onnx_format_full_quant(self): model_name = "feedasq_nohadama" self.run_test(model_name, threads_num=1) +@unittest.skipUnless( + _HAS_IR_GRAPH, + "Requires paddle.fluid.framework.IrGraph, removed in PaddlePaddle 3.x", +) class TestPostTrainingVideofeedasqONNXFormatFullQuant(TestPostTrainingQuantization): def test_post_training_videofeedasq_onnx_format_full_quant(self): model_name = "videofeedasq" self.run_test(model_name, threads_num=1) +@unittest.skipUnless( + _HAS_IR_GRAPH, + "Requires paddle.fluid.framework.IrGraph, removed in PaddlePaddle 3.x", +) class TestPostTrainingLiminghaoONNXFormatFullQuant(TestPostTrainingQuantization): def test_post_training_liminghao_onnx_format_full_quant(self): model_name = "liminghao" diff --git a/tests/test_reciprocal.py b/tests/test_reciprocal.py index cdf5770ee..fc8001121 100644 --- a/tests/test_reciprocal.py +++ b/tests/test_reciprocal.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.reciprocal(inputs) - return x + return paddle.reciprocal(inputs) @_test_with_pir diff --git a/tests/test_register_buffer.py b/tests/test_register_buffer.py index 68fa1f5de..607788ff7 100644 --- a/tests/test_register_buffer.py +++ b/tests/test_register_buffer.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() self.register_buffer( "my_buffer", paddle.to_tensor(10, dtype="float32"), diff --git a/tests/test_relu.py b/tests/test_relu.py index f64eeb8ab..4575a29b4 100644 --- a/tests/test_relu.py +++ b/tests/test_relu.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.relu(inputs) - return x + return paddle.nn.functional.relu(inputs) @_test_with_pir diff --git a/tests/test_relu6.py b/tests/test_relu6.py index d81233bb0..afac67927 100644 --- a/tests/test_relu6.py +++ b/tests/test_relu6.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.relu6(inputs) - return x + return paddle.nn.functional.relu6(inputs) @_test_with_pir diff --git a/tests/test_repeat_interleave.py b/tests/test_repeat_interleave.py index 1e4d48cda..15e978157 100644 --- a/tests/test_repeat_interleave.py +++ b/tests/test_repeat_interleave.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_only_pir class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ @@ -31,8 +31,7 @@ def forward(self, inputs): """ # repeats = paddle.to_tensor([3,2,1], dtype='int32') - x = paddle.repeat_interleave(inputs, repeats=2, axis=0) - return x + return paddle.repeat_interleave(inputs, repeats=2, axis=0) @_test_only_pir @@ -58,7 +57,7 @@ class Net2(paddle.nn.Layer): """ def __init__(self): - super(Net2, self).__init__() + super().__init__() def forward(self, inputs): """ @@ -66,8 +65,7 @@ def forward(self, inputs): """ repeats = paddle.to_tensor([3, 2, 1], dtype="int32") - x = paddle.repeat_interleave(inputs, repeats=repeats, axis=1) - return x + return paddle.repeat_interleave(inputs, repeats=repeats, axis=1) @_test_only_pir diff --git a/tests/test_reshape.py b/tests/test_reshape.py index e06fdcefb..93848dda4 100644 --- a/tests/test_reshape.py +++ b/tests/test_reshape.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.reshape(inputs, [3, -1, 2]) - return x + return paddle.reshape(inputs, [3, -1, 2]) def test_reshape_9(): diff --git a/tests/test_resnet_fp16.py b/tests/test_resnet_fp16.py index 69d7737d0..99139683c 100644 --- a/tests/test_resnet_fp16.py +++ b/tests/test_resnet_fp16.py @@ -13,12 +13,13 @@ # limitations under the License. import os + import numpy as np import onnxruntime import paddle import paddle2onnx -from paddle.inference import PrecisionType, PlaceType, convert_to_mixed_precision +from paddle.inference import PlaceType, PrecisionType, convert_to_mixed_precision def test_resnet_fp16_convert(): diff --git a/tests/test_roi_align.py b/tests/test_roi_align.py index 8b50ab568..3fd889f2b 100644 --- a/tests/test_roi_align.py +++ b/tests/test_roi_align.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_only_pir class BaseNet(paddle.nn.Layer): def __init__(self): - super(BaseNet, self).__init__() + super().__init__() self.output_size = 3 self.spatial_scale = 1.0 self.sampling_ratio = -1 diff --git a/tests/test_roll.py b/tests/test_roll.py index 571c15898..0e7531839 100644 --- a/tests/test_roll.py +++ b/tests/test_roll.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.roll(inputs, 1) - return x + return paddle.roll(inputs, 1) @_test_with_pir diff --git a/tests/test_round.py b/tests/test_round.py index cde4b1bb6..cad181f9e 100644 --- a/tests/test_round.py +++ b/tests/test_round.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.round(inputs) - return x + return paddle.round(inputs) @_test_with_pir diff --git a/tests/test_rsqrt.py b/tests/test_rsqrt.py index 07efc45cd..4aa9ecef8 100644 --- a/tests/test_rsqrt.py +++ b/tests/test_rsqrt.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.rsqrt(inputs) - return x + return paddle.rsqrt(inputs) def test_rsqrt_10(): diff --git a/tests/test_scatter.py b/tests/test_scatter.py index c262a7dd0..26a894e63 100644 --- a/tests/test_scatter.py +++ b/tests/test_scatter.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx +import paddle + class Net(paddle.nn.Layer): """ @@ -22,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, overwrite=True): - super(Net, self).__init__() + super().__init__() self.overwrite = overwrite def forward(self, inputs, _index, _updates): """ forward """ - x = paddle.scatter(inputs, _index, _updates, overwrite=self.overwrite) - return x + return paddle.scatter(inputs, _index, _updates, overwrite=self.overwrite) def test_scatter_11(): diff --git a/tests/test_scatter_nd_add.py b/tests/test_scatter_nd_add.py index 503ebd737..33b8cd0b9 100644 --- a/tests/test_scatter_nd_add.py +++ b/tests/test_scatter_nd_add.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx, _test_with_pir +import paddle + class Net(paddle.nn.Layer): """ @@ -22,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, _index, _updates): """ forward """ - x = paddle.scatter_nd_add(inputs, _index, _updates) - return x + return paddle.scatter_nd_add(inputs, _index, _updates) @_test_with_pir diff --git a/tests/test_selu.py b/tests/test_selu.py index 612bc82dd..798032873 100644 --- a/tests/test_selu.py +++ b/tests/test_selu.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -27,7 +27,7 @@ def __init__( alpha=1.6732632423543772848170429916717, scale=1.0507009873554804934193349852946, ): - super(Net, self).__init__() + super().__init__() self.alpha = alpha self.scale = scale @@ -35,8 +35,7 @@ def forward(self, inputs): """ forward """ - x = paddle.nn.functional.selu(inputs, alpha=self.alpha, scale=self.scale) - return x + return paddle.nn.functional.selu(inputs, alpha=self.alpha, scale=self.scale) def test_nn_functional_selu_10(): diff --git a/tests/test_set_value.py b/tests/test_set_value.py index a0f88edba..c820b3029 100644 --- a/tests/test_set_value.py +++ b/tests/test_set_value.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_only_pir class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self, config): - super(Net, self).__init__() + super().__init__() self.config = config def forward(self, input): diff --git a/tests/test_shape.py b/tests/test_shape.py index 8aaac5f79..afb39466b 100644 --- a/tests/test_shape.py +++ b/tests/test_shape.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.shape(inputs).astype("int32") - return x + return paddle.shape(inputs).astype("int32") @_test_with_pir diff --git a/tests/test_share_data.py b/tests/test_share_data.py index 01b799caa..da70c089a 100644 --- a/tests/test_share_data.py +++ b/tests/test_share_data.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_only_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle._C_ops.share_data(inputs) - return x + return paddle._C_ops.share_data(inputs) @_test_only_pir diff --git a/tests/test_sigmoid.py b/tests/test_sigmoid.py index 62bebc98c..0ba12bb74 100644 --- a/tests/test_sigmoid.py +++ b/tests/test_sigmoid.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.sigmoid(inputs) - return x + return paddle.nn.functional.sigmoid(inputs) @_test_with_pir diff --git a/tests/test_sign.py b/tests/test_sign.py index 7a56c0427..df1ad42a1 100644 --- a/tests/test_sign.py +++ b/tests/test_sign.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.sign(inputs) - return x + return paddle.sign(inputs) def test_sign_9(): diff --git a/tests/test_sin.py b/tests/test_sin.py index 3a3683262..e4dd47f9a 100644 --- a/tests/test_sin.py +++ b/tests/test_sin.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.sin(inputs) - return x + return paddle.sin(inputs) @_test_with_pir diff --git a/tests/test_sinh.py b/tests/test_sinh.py index 5ed045008..307b12c14 100644 --- a/tests/test_sinh.py +++ b/tests/test_sinh.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.sinh(inputs) - return x + return paddle.sinh(inputs) @_test_with_pir diff --git a/tests/test_slice.py b/tests/test_slice.py index e5fe6a2b1..a11bcb907 100644 --- a/tests/test_slice.py +++ b/tests/test_slice.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.slice(inputs, axes=[0, 1], starts=[1, 0], ends=[4, 7]) - return x + return paddle.slice(inputs, axes=[0, 1], starts=[1, 0], ends=[4, 7]) # @_test_with_pir diff --git a/tests/test_softplus.py b/tests/test_softplus.py index 453b7ab5b..37507e677 100644 --- a/tests/test_softplus.py +++ b/tests/test_softplus.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.softplus(inputs) - return x + return paddle.nn.functional.softplus(inputs) @_test_with_pir diff --git a/tests/test_softshrink.py b/tests/test_softshrink.py index ad41351f6..6efc57ac7 100644 --- a/tests/test_softshrink.py +++ b/tests/test_softshrink.py @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle import paddle.nn as nn -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -25,15 +24,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, threshold=0.5): - super(Net, self).__init__() + super().__init__() self.threshold = threshold def forward(self, inputs): """ forward """ - x = nn.functional.softshrink(inputs, threshold=self.threshold) - return x + return nn.functional.softshrink(inputs, threshold=self.threshold) @_test_with_pir diff --git a/tests/test_split.py b/tests/test_split.py index f9aab469b..18369b88b 100644 --- a/tests/test_split.py +++ b/tests/test_split.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.split(inputs, num_or_sections=5, axis=1) - return x + return paddle.split(inputs, num_or_sections=5, axis=1) class Net2(paddle.nn.Layer): @@ -40,14 +38,13 @@ class Net2(paddle.nn.Layer): """ def __init__(self): - super(Net2, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.split(inputs, num_or_sections=[2, 3, 5], axis=-1) - return x + return paddle.split(inputs, num_or_sections=[2, 3, 5], axis=-1) # @_test_with_pir diff --git a/tests/test_square.py b/tests/test_square.py index dbf1591b7..e16c9adf0 100644 --- a/tests/test_square.py +++ b/tests/test_square.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.square(inputs) - return x + return paddle.square(inputs) @_test_with_pir diff --git a/tests/test_squeeze.py b/tests/test_squeeze.py index d33f91300..41e301fad 100644 --- a/tests/test_squeeze.py +++ b/tests/test_squeeze.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, axis=0): - super(Net, self).__init__() + super().__init__() self.axis = axis def forward(self, inputs): """ forward """ - x = paddle.squeeze(inputs, axis=self.axis) - return x + return paddle.squeeze(inputs, axis=self.axis) def test_squeeze_9(): diff --git a/tests/test_stack.py b/tests/test_stack.py index 7acf78d35..c9823e980 100644 --- a/tests/test_stack.py +++ b/tests/test_stack.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, inputs_): """ forward """ - x = paddle.stack([inputs, inputs_]) - return x + return paddle.stack([inputs, inputs_]) @_test_with_pir diff --git a/tests/test_sum.py b/tests/test_sum.py index 9fe62a56d..26f31c65e 100644 --- a/tests/test_sum.py +++ b/tests/test_sum.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.sum(inputs, axis=0) - return x + return paddle.sum(inputs, axis=0) def test_sum_13_18(): diff --git a/tests/test_swish.py b/tests/test_swish.py index 8411e942b..d50edfe86 100644 --- a/tests/test_swish.py +++ b/tests/test_swish.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.nn.functional.swish(inputs) - return x + return paddle.nn.functional.swish(inputs) @_test_with_pir diff --git a/tests/test_tan.py b/tests/test_tan.py index eba01623a..7e0174efb 100644 --- a/tests/test_tan.py +++ b/tests/test_tan.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.tan(inputs) - return x + return paddle.tan(inputs) @_test_with_pir diff --git a/tests/test_tanh.py b/tests/test_tanh.py index 5a2f40703..5e179c3a0 100644 --- a/tests/test_tanh.py +++ b/tests/test_tanh.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool, _test_with_pir class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.tanh(inputs) - return x + return paddle.tanh(inputs) @_test_with_pir diff --git a/tests/test_tensor_array.py b/tests/test_tensor_array.py index b15b0ac99..afbcb5860 100644 --- a/tests/test_tensor_array.py +++ b/tests/test_tensor_array.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_only_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_only_pir class BaseNet(paddle.nn.Layer): def __init__(self): - super(BaseNet, self).__init__() + super().__init__() def forward(self, input): arr = paddle.tensor.create_array(dtype="float32") diff --git a/tests/test_tile.py b/tests/test_tile.py index ffc2b1090..322e4f149 100644 --- a/tests/test_tile.py +++ b/tests/test_tile.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.tile(inputs, repeat_times=[2, 1]) - return x + return paddle.tile(inputs, repeat_times=[2, 1]) @_test_with_pir diff --git a/tests/test_topk.py b/tests/test_topk.py index efaebdc72..9018d3827 100644 --- a/tests/test_topk.py +++ b/tests/test_topk.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -23,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ diff --git a/tests/test_transpose.py b/tests/test_transpose.py index 10fc8aee8..1910fe2bd 100644 --- a/tests/test_transpose.py +++ b/tests/test_transpose.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.transpose(inputs, perm=[1, 0, 2]) - return x + return paddle.transpose(inputs, perm=[1, 0, 2]) @_test_with_pir diff --git a/tests/test_tril_triu.py b/tests/test_tril_triu.py index e7394c9d7..89023c911 100644 --- a/tests/test_tril_triu.py +++ b/tests/test_tril_triu.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ @@ -59,7 +58,7 @@ class Net2(paddle.nn.Layer): """ def __init__(self): - super(Net2, self).__init__() + super().__init__() def forward(self, inputs): """ @@ -94,7 +93,7 @@ class Net3(paddle.nn.Layer): """ def __init__(self): - super(Net3, self).__init__() + super().__init__() def forward(self, inputs): """ @@ -129,7 +128,7 @@ class Net4(paddle.nn.Layer): """ def __init__(self): - super(Net4, self).__init__() + super().__init__() def forward(self, inputs): """ diff --git a/tests/test_unbind.py b/tests/test_unbind.py index 3912181f0..adb3007c4 100644 --- a/tests/test_unbind.py +++ b/tests/test_unbind.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from onnxbase import APIOnnx, _test_with_pir +import paddle + class Net(paddle.nn.Layer): """ @@ -22,7 +23,7 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, axis=1): """ diff --git a/tests/test_unfold.py b/tests/test_unfold.py index c6783d6aa..dcf7c86b1 100644 --- a/tests/test_unfold.py +++ b/tests/test_unfold.py @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool import paddle.nn.functional as F -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -25,14 +24,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, x): """ forward """ - x = F.unfold(x, [3, 3], 1, 1, 1) - return x + return F.unfold(x, [3, 3], 1, 1, 1) @_test_with_pir diff --git a/tests/test_unique.py b/tests/test_unique.py index dad9665e6..280f0f9f8 100644 --- a/tests/test_unique.py +++ b/tests/test_unique.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,16 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, axis=None): - super(Net, self).__init__() + super().__init__() self.axis = axis def forward(self, inputs): """ forward """ - x = paddle.unique(inputs, axis=self.axis) - - return x + return paddle.unique(inputs, axis=self.axis) @_test_with_pir @@ -95,7 +92,7 @@ class Net_mult_2(paddle.nn.Layer): def __init__( self, return_index=False, return_inverse=False, return_counts=False, axis=None ): - super(Net_mult_2, self).__init__() + super().__init__() self.return_index = return_index self.return_inverse = return_inverse self.return_counts = return_counts @@ -175,7 +172,7 @@ class Net_mult_3(paddle.nn.Layer): def __init__( self, return_index=False, return_inverse=False, return_counts=False, axis=None ): - super(Net_mult_3, self).__init__() + super().__init__() self.return_index = return_index self.return_inverse = return_inverse self.return_counts = return_counts @@ -253,7 +250,7 @@ class Net_mult_all(paddle.nn.Layer): """ def __init__(self, axis=None): - super(Net_mult_all, self).__init__() + super().__init__() self.axis = axis def forward(self, inputs): diff --git a/tests/test_unsqueeze.py b/tests/test_unsqueeze.py index 4d5a881ff..28102ab62 100755 --- a/tests/test_unsqueeze.py +++ b/tests/test_unsqueeze.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,15 +23,14 @@ class Net(paddle.nn.Layer): """ def __init__(self, axis=0): - super(Net, self).__init__() + super().__init__() self.axis = axis def forward(self, inputs): """ forward """ - x = paddle.unsqueeze(inputs, axis=self.axis) - return x + return paddle.unsqueeze(inputs, axis=self.axis) @_test_with_pir diff --git a/tests/test_where.py b/tests/test_where.py index 92fd1c1e2..f1f36db15 100644 --- a/tests/test_where.py +++ b/tests/test_where.py @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool -from onnxbase import _test_with_pir class Net(paddle.nn.Layer): @@ -24,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs, _inputs): """ forward """ - x = paddle.where(inputs < _inputs, inputs, _inputs) - return x + return paddle.where(inputs < _inputs, inputs, _inputs) @_test_with_pir diff --git a/tests/test_while.py b/tests/test_while.py index c4e83b258..3ec214c1d 100644 --- a/tests/test_while.py +++ b/tests/test_while.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, _test_with_pir + import paddle -from onnxbase import APIOnnx -from onnxbase import _test_with_pir class BaseNet1(paddle.nn.Layer): def __init__(self): - super(BaseNet1, self).__init__() + super().__init__() def forward(self, inputs): i = 0 @@ -40,7 +40,7 @@ def test_while_1(): class BaseNet2(paddle.nn.Layer): def __init__(self): - super(BaseNet2, self).__init__() + super().__init__() def forward(self, i, inputs): while i <= 3: @@ -60,7 +60,7 @@ def test_while_2(): class BaseNet3(paddle.nn.Layer): def __init__(self): - super(BaseNet3, self).__init__() + super().__init__() def forward(self, i, j, k): while i <= 3: @@ -83,7 +83,7 @@ def test_while_3(): class BaseNet4(paddle.nn.Layer): def __init__(self): - super(BaseNet4, self).__init__() + super().__init__() def forward(self, i, j, k): while i <= 3: @@ -108,7 +108,7 @@ def test_while_4(): class BaseNet5(paddle.nn.Layer): def __init__(self): - super(BaseNet5, self).__init__() + super().__init__() def forward(self, i, j, k): while i <= 3: diff --git a/tests/test_zeros_like.py b/tests/test_zeros_like.py index 35671ef54..f0a8db4cb 100644 --- a/tests/test_zeros_like.py +++ b/tests/test_zeros_like.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from onnxbase import APIOnnx, randtool + import paddle -from onnxbase import APIOnnx -from onnxbase import randtool class Net(paddle.nn.Layer): @@ -23,14 +23,13 @@ class Net(paddle.nn.Layer): """ def __init__(self): - super(Net, self).__init__() + super().__init__() def forward(self, inputs): """ forward """ - x = paddle.zeros_like(inputs, dtype=None, name=None) - return x + return paddle.zeros_like(inputs, dtype=None, name=None) def test_zeros_like_base(): diff --git a/third_party/glog b/third_party/glog deleted file mode 160000 index 96a2f23dc..000000000 --- a/third_party/glog +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 96a2f23dca4cc7180821ca5f32e526314395d26a diff --git a/third_party/onnx b/third_party/onnx deleted file mode 160000 index 990217f04..000000000 --- a/third_party/onnx +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 990217f043af7222348ca8f0301e17fa7b841781 diff --git a/third_party/optimizer b/third_party/optimizer deleted file mode 160000 index b3a461186..000000000 --- a/third_party/optimizer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b3a4611861734e0731bbcc2bed1f080139e4988b diff --git a/third_party/pybind11 b/third_party/pybind11 deleted file mode 160000 index 3e9dfa286..000000000 --- a/third_party/pybind11 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3e9dfa2866941655c56877882565e7577de6fc7b diff --git a/tools/codestyle/clang-tidy.py b/tools/codestyle/clang-tidy.py index 3d7fd7c6b..4e82a15f8 100644 --- a/tools/codestyle/clang-tidy.py +++ b/tools/codestyle/clang-tidy.py @@ -36,7 +36,6 @@ http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html """ - import argparse import glob import json @@ -83,7 +82,7 @@ def make_absolute(f, directory): def analysis_gitignore(path, filename=".gitignore"): """Analysis gitignore file and return ignore file list""" - with open(path + "/" + filename, "r") as f: + with open(path + "/" + filename) as f: lines = f.readlines() ignore_file_list = [] for line in lines: @@ -171,7 +170,7 @@ def merge_replacement_files(tmpdir, mergefile): mergekey = "Diagnostics" merged = [] for replacefile in glob.iglob(os.path.join(tmpdir, "*.yaml")): - content = yaml.safe_load(open(replacefile, "r")) + content = yaml.safe_load(open(replacefile)) if not content: continue # Skip empty files. merged.extend(content.get(mergekey, [])) @@ -268,7 +267,7 @@ def main(): parser.add_argument( "-checks", default=None, - help="checks filter, when not specified, use clang-tidy " "default", + help="checks filter, when not specified, use clang-tidy default", ) parser.add_argument( "-config", @@ -313,12 +312,12 @@ def main(): parser.add_argument( "-format", action="store_true", - help="Reformat code " "after applying fixes", + help="Reformat code after applying fixes", ) parser.add_argument( "-style", default="file", - help="The style of reformat " "code after applying fixes", + help="The style of reformat code after applying fixes", ) parser.add_argument( "-p", @@ -330,14 +329,14 @@ def main(): dest="extra_arg", action="append", default=[], - help="Additional argument to append to the compiler " "command line.", + help="Additional argument to append to the compiler command line.", ) parser.add_argument( "-extra-arg-before", dest="extra_arg_before", action="append", default=[], - help="Additional argument to prepend to the compiler " "command line.", + help="Additional argument to prepend to the compiler command line.", ) parser.add_argument( "-quiet", action="store_true", help="Run clang-tidy in quiet mode" diff --git a/tools/codestyle/copyright.py b/tools/codestyle/copyright.py index d3f7e2b0d..675a286e1 100644 --- a/tools/codestyle/copyright.py +++ b/tools/codestyle/copyright.py @@ -67,20 +67,16 @@ def _get_comment_mark(path): def _check_copyright(path): head = [] try: - with open(path, "r", encoding="utf-8") as f: + with open(path, encoding="utf-8") as f: head = [next(f) for x in range(4)] except StopIteration: pass - for idx, line in enumerate(head): - if RE_COPYRIGHT.search(line) is not None: - return True - - return False + return any(RE_COPYRIGHT.search(line) is not None for idx, line in enumerate(head)) def generate_copyright(path, comment_mark): - original_contents = open(path, "r", encoding="utf-8").readlines() + original_contents = open(path, encoding="utf-8").readlines() head = original_contents[0:4] insert_line_no = 0 diff --git a/tools/onnx/onnx_infer_shape.py b/tools/onnx/onnx_infer_shape.py index 632ab6163..1b4878dcf 100755 --- a/tools/onnx/onnx_infer_shape.py +++ b/tools/onnx/onnx_infer_shape.py @@ -14,11 +14,11 @@ import argparse import logging + import numpy as np import onnx -from onnx import helper, numpy_helper, shape_inference import sympy - +from onnx import helper, numpy_helper, shape_inference from packaging import version assert version.parse(onnx.__version__) >= version.parse("1.8.0") @@ -51,8 +51,7 @@ def get_shape_from_type_proto(type_proto): assert not is_sequence(type_proto) if type_proto.tensor_type.HasField("shape"): return [get_dim_from_proto(d) for d in type_proto.tensor_type.shape.dim] - else: - return None # note no shape is different from shape without dim (scalar) + return None # note no shape is different from shape without dim (scalar) def get_shape_from_value_info(vi): @@ -60,12 +59,10 @@ def get_shape_from_value_info(vi): if cls_type is None: return None if is_sequence(vi.type): - if "tensor_type" == vi.type.sequence_type.elem_type.WhichOneof("value"): + if vi.type.sequence_type.elem_type.WhichOneof("value") == "tensor_type": return get_shape_from_type_proto(vi.type.sequence_type.elem_type) - else: - return None - else: - return get_shape_from_type_proto(vi.type) + return None + return get_shape_from_type_proto(vi.type) def make_named_value_info(name): @@ -107,21 +104,19 @@ def as_scalar(x): if isinstance(x, list): assert len(x) == 1 return x[0] - elif isinstance(x, np.ndarray): + if isinstance(x, np.ndarray): return x.item() - else: - return x + return x def as_list(x, keep_none): if isinstance(x, list): return x - elif isinstance(x, np.ndarray): + if isinstance(x, np.ndarray): return list(x) - elif keep_none and x is None: + if keep_none and x is None: return None - else: - return [x] + return [x] def sympy_reduce_product(x): @@ -236,10 +231,8 @@ def __init__(self, int_max, auto_merge, guess_output_rank, verbose, prefix=""): def _add_suggested_merge(self, symbols, apply=False): assert all( - [ - (isinstance(s, str) and s in self.symbolic_dims_) or is_literal(s) - for s in symbols - ] + (isinstance(s, str) and s in self.symbolic_dims_) or is_literal(s) + for s in symbols ) symbols = set(symbols) for k, v in self.suggested_merge_.items(): @@ -305,25 +298,18 @@ def _apply_suggested_merge(self, graph_input_only=False): def _preprocess(self, in_mp): self.out_mp_ = onnx.ModelProto() self.out_mp_.CopyFrom(in_mp) - self.graph_inputs_ = dict([(i.name, i) for i in list(self.out_mp_.graph.input)]) - self.initializers_ = dict([(i.name, i) for i in self.out_mp_.graph.initializer]) - self.known_vi_ = dict([(i.name, i) for i in list(self.out_mp_.graph.input)]) + self.graph_inputs_ = {i.name: i for i in list(self.out_mp_.graph.input)} + self.initializers_ = {i.name: i for i in self.out_mp_.graph.initializer} + self.known_vi_ = {i.name: i for i in list(self.out_mp_.graph.input)} self.known_vi_.update( - dict( - [ - ( - i.name, - helper.make_tensor_value_info( - i.name, i.data_type, list(i.dims) - ), - ) - for i in self.out_mp_.graph.initializer - ] - ) + { + i.name: helper.make_tensor_value_info(i.name, i.data_type, list(i.dims)) + for i in self.out_mp_.graph.initializer + } ) def _merge_symbols(self, dims): - if not all([isinstance(d, str) for d in dims]): + if not all(isinstance(d, str) for d in dims): if self.auto_merge_: unique_dims = list(set(dims)) is_int = [is_literal(d) for d in unique_dims] @@ -334,33 +320,23 @@ def _merge_symbols(self, dims): int_dim = is_int.index(1) if self.verbose_ > 0: logger.debug( - "dim {} has been merged with value {}".format( - unique_dims[:int_dim] + unique_dims[int_dim + 1 :], - unique_dims[int_dim], - ) + f"dim {unique_dims[:int_dim] + unique_dims[int_dim + 1 :]} has been merged with value {unique_dims[int_dim]}" ) self._check_merged_dims(unique_dims, allow_broadcast=False) return unique_dims[int_dim] - else: - if self.verbose_ > 0: - logger.debug( - "dim {} has been mergd with dim {}".format( - unique_dims[1:], unique_dims[0] - ) - ) - return dims[0] - else: - return None - if all([d == dims[0] for d in dims]): + if self.verbose_ > 0: + logger.debug( + f"dim {unique_dims[1:]} has been mergd with dim {unique_dims[0]}" + ) + return dims[0] + return None + if all(d == dims[0] for d in dims): return dims[0] - merged = [ - self.suggested_merge_[d] if d in self.suggested_merge_ else d for d in dims - ] - if all([d == merged[0] for d in merged]): + merged = [self.suggested_merge_.get(d, d) for d in dims] + if all(d == merged[0] for d in merged): assert merged[0] in self.symbolic_dims_ return merged[0] - else: - return None + return None # broadcast from right to left, and merge symbolic dims if needed def _broadcast_shapes(self, shape1, shape2): @@ -390,7 +366,7 @@ def _broadcast_shapes(self, shape1, shape2): + " " + str(dim2) ) - new_shape = [new_dim] + new_shape + new_shape = [new_dim, *new_shape] return new_shape def _get_shape(self, node, idx): @@ -398,9 +374,8 @@ def _get_shape(self, node, idx): if name in self.known_vi_: vi = self.known_vi_[name] return get_shape_from_value_info(vi) - else: - assert name in self.initializers_ - return list(self.initializers_[name].dims) + assert name in self.initializers_ + return list(self.initializers_[name].dims) def _get_shape_rank(self, node, idx): return len(self._get_shape(node, idx)) @@ -477,7 +452,7 @@ def _onnx_infer_single_node(self, node): # (2) opset version >= 9. In older version, initializer is required in graph input by onnx spec. # (3) The initializer is not in graph input. The means the node input is "constant" in inference. initializers = [] - if (get_opset(self.out_mp_) >= 9) and node.op_type in ["Unsqueeze"]: + if (get_opset(self.out_mp_) >= 9) and node.op_type == "Unsqueeze": initializers = [ self.initializers_[name] for name in node.input @@ -511,20 +486,18 @@ def _onnx_infer_subgraph( ): if self.verbose_ > 2: logger.debug( - "Inferencing subgraph of node {} with output({}...): {}".format( - node.name, node.output[0], node.op_type - ) + f"Inferencing subgraph of node {node.name} with output({node.output[0]}...): {node.op_type}" ) # node inputs are not passed directly to the subgraph # it's up to the node dispatcher to prepare subgraph input # for example, with Scan/Loop, subgraph input shape would be trimmed from node input shape # besides, inputs in subgraph could shadow implicit inputs - subgraph_inputs = set( - [i.name for i in list(subgraph.initializer) + list(subgraph.input)] - ) - subgraph_implicit_input = set( - [name for name in self.known_vi_.keys() if name not in subgraph_inputs] - ) + subgraph_inputs = { + i.name for i in list(subgraph.initializer) + list(subgraph.input) + } + subgraph_implicit_input = { + name for name in self.known_vi_ if name not in subgraph_inputs + } tmp_graph = helper.make_graph( list(subgraph.node), "tmp", @@ -574,15 +547,13 @@ def _onnx_infer_subgraph( get_shape_from_value_info(o) for o in symbolic_shape_inference.out_mp_.graph.output ] - subgraph_new_symbolic_dims = set( - [ - d - for s in subgraph_shapes - if s - for d in s - if isinstance(d, str) and d not in self.symbolic_dims_ - ] - ) + subgraph_new_symbolic_dims = { + d + for s in subgraph_shapes + if s + for d in s + if isinstance(d, str) and d not in self.symbolic_dims_ + } new_dims = {} for d in subgraph_new_symbolic_dims: assert d in symbolic_shape_inference.symbolic_dims_ @@ -592,7 +563,7 @@ def _onnx_infer_subgraph( def _get_int_values(self, node, broadcast=False): values = [self._try_get_value(node, i) for i in range(len(node.input))] - if all([v is not None for v in values]): + if all(v is not None for v in values): # some shape compute is in floating point, cast to int for sympy for i, v in enumerate(values): if not isinstance(v, np.ndarray): @@ -624,11 +595,13 @@ def _get_int_values(self, node, broadcast=False): def _compute_on_sympy_data(self, node, op_func): assert len(node.output) == 1 values = self._get_int_values(node, broadcast=True) - if all([v is not None for v in values]): + if all(v is not None for v in values): is_list = [isinstance(v, list) for v in values] as_list = any(is_list) if as_list: - self.sympy_data_[node.output[0]] = [op_func(vs) for vs in zip(*values)] + self.sympy_data_[node.output[0]] = [ + op_func(vs) for vs in zip(*values, strict=False) + ] else: self.sympy_data_[node.output[0]] = op_func(values) @@ -651,7 +624,7 @@ def _pass_on_shape_and_type(self, node): ) def _new_symbolic_dim(self, prefix, dim): - new_dim = "{}_d{}".format(prefix, dim) + new_dim = f"{prefix}_d{dim}" if new_dim in self.suggested_merge_: v = self.suggested_merge_[new_dim] new_symbolic_dim = sympy.Integer(int(v)) if is_literal(v) else v @@ -662,12 +635,7 @@ def _new_symbolic_dim(self, prefix, dim): def _new_symbolic_dim_from_output(self, node, out_idx=0, dim=0): return self._new_symbolic_dim( - "{}{}_{}_o{}_".format( - node.op_type, - self.prefix_, - list(self.out_mp_.graph.node).index(node), - out_idx, - ), + f"{node.op_type}{self.prefix_}_{list(self.out_mp_.graph.node).index(node)}_o{out_idx}_", dim, ) @@ -703,7 +671,7 @@ def _compute_conv_pool_shape(self, node): dilations = get_attribute(node, "dilations", [1] * rank) strides = get_attribute(node, "strides", [1] * rank) effective_kernel_shape = [ - (k - 1) * d + 1 for k, d in zip(kernel_shape, dilations) + (k - 1) * d + 1 for k, d in zip(kernel_shape, dilations, strict=False) ] pads = get_attribute(node, "pads") if pads is None: @@ -712,17 +680,19 @@ def _compute_conv_pool_shape(self, node): if auto_pad != "VALID" and auto_pad != "NOTSET": try: residual = [ - sympy.Mod(d, s) for d, s in zip(sympy_shape[-rank:], strides) + sympy.Mod(d, s) + for d, s in zip(sympy_shape[-rank:], strides, strict=False) ] total_pads = [ max(0, (k - s) if r == 0 else (k - r)) - for k, s, r in zip(effective_kernel_shape, strides, residual) + for k, s, r in zip( + effective_kernel_shape, strides, residual, strict=False + ) ] - except ( - TypeError - ): # sympy may throw TypeError: cannot determine truth value of Relational + except TypeError: # sympy may throw TypeError: cannot determine truth value of Relational total_pads = [ - max(0, (k - s)) for k, s in zip(effective_kernel_shape, strides) + max(0, (k - s)) + for k, s in zip(effective_kernel_shape, strides, strict=False) ] # assuming no residual if sympy throws error elif auto_pad == "VALID": total_pads = [] @@ -730,7 +700,9 @@ def _compute_conv_pool_shape(self, node): total_pads = [0] * rank else: assert len(pads) == 2 * rank - total_pads = [p1 + p2 for p1, p2 in zip(pads[:rank], pads[rank:])] + total_pads = [ + p1 + p2 for p1, p2 in zip(pads[:rank], pads[rank:], strict=False) + ] ceil_mode = get_attribute(node, "ceil_mode", 0) for i in range(rank): @@ -751,7 +723,7 @@ def _compute_conv_pool_shape(self, node): def _check_merged_dims(self, dims, allow_broadcast=True): if allow_broadcast: dims = [d for d in dims if not (is_literal(d) and int(d) <= 1)] - if not all([d == dims[0] for d in dims]): + if not all(d == dims[0] for d in dims): self._add_suggested_merge(dims, apply=True) def _compute_matmul_shape(self, node, output_dtype=None): @@ -766,18 +738,18 @@ def _compute_matmul_shape(self, node, output_dtype=None): new_shape = [] elif lhs_rank == 1: rhs_reduce_dim = -2 - new_shape = rhs_shape[:rhs_reduce_dim] + [rhs_shape[-1]] + new_shape = [*rhs_shape[:rhs_reduce_dim], rhs_shape[-1]] elif rhs_rank == 1: lhs_reduce_dim = -1 new_shape = lhs_shape[:lhs_reduce_dim] else: lhs_reduce_dim = -1 rhs_reduce_dim = -2 - new_shape = ( - self._broadcast_shapes(lhs_shape[:-2], rhs_shape[:-2]) - + [lhs_shape[-2]] - + [rhs_shape[-1]] - ) + new_shape = [ + *self._broadcast_shapes(lhs_shape[:-2], rhs_shape[:-2]), + lhs_shape[-2], + rhs_shape[-1], + ] # merge reduce dim self._check_merged_dims( [lhs_shape[lhs_reduce_dim], rhs_shape[rhs_reduce_dim]], @@ -806,7 +778,7 @@ def _fuse_tensor_type(self, node, out_idx, dst_type, src_type): else src_type.tensor_type ) if dst_tensor_type.elem_type != src_tensor_type.elem_type: - node_id = node.name if node.name else node.op_type + node_id = node.name or node.op_type raise ValueError( f"For node {node_id}, dst_tensor_type.elem_type != src_tensor_type.elem_type: " f"{onnx.onnx_pb.TensorProto.DataType.Name(dst_tensor_type.elem_type)} vs " @@ -814,7 +786,7 @@ def _fuse_tensor_type(self, node, out_idx, dst_type, src_type): ) if dst_tensor_type.HasField("shape"): for di, ds in enumerate( - zip(dst_tensor_type.shape.dim, src_tensor_type.shape.dim) + zip(dst_tensor_type.shape.dim, src_tensor_type.shape.dim, strict=False) ): if ds[0] != ds[1]: # create a new symbolic dimension for node/out_idx/mismatch dim id in dst_tensor_type for tensor_type @@ -909,14 +881,14 @@ def _infer_Compress(self, node): ) def _infer_Concat(self, node): - if any([i in self.sympy_data_ or i in self.initializers_ for i in node.input]): + if any(i in self.sympy_data_ or i in self.initializers_ for i in node.input): values = self._get_int_values(node) print("=======", values, node.name, get_attribute(node, "axis")) - if all([v is not None for v in values]): + if all(v is not None for v in values): axis = get_attribute(node, "axis") if axis < 0: axis = axis + len(values[0]) - assert 0 == axis + assert axis == 0 self.sympy_data_[node.output[0]] = [] for i in range(len(node.input)): value = values[i] @@ -941,7 +913,7 @@ def _infer_Concat(self, node): for i_idx in range(len(node.input)) if self._get_shape(node, i_idx) ] - if all([d == dims[0] for d in dims]): + if all(d == dims[0] for d in dims): continue merged = self._merge_symbols(dims) if isinstance(merged, str): @@ -966,7 +938,7 @@ def _infer_ConcatFromSequence(self, node): concat_dim = str(self._new_symbolic_dim_from_output(node, 0, axis)) new_shape = seq_shape if new_axis: - new_shape = seq_shape[:axis] + [concat_dim] + seq_shape[axis:] + new_shape = [*seq_shape[:axis], concat_dim, *seq_shape[axis:]] else: new_shape[axis] = concat_dim vi = self.known_vi_[node.output[0]] @@ -993,7 +965,7 @@ def _infer_ConstantOfShape(self, node): self._update_computed_dims(sympy_shape) # update sympy data if output type is int, and shape is known if vi.type.tensor_type.elem_type == onnx.TensorProto.INT64 and all( - [is_literal(x) for x in sympy_shape] + is_literal(x) for x in sympy_shape ): self.sympy_data_[node.output[0]] = np.ones( [int(x) for x in sympy_shape], dtype=np.int64 @@ -1049,9 +1021,7 @@ def _infer_Einsum(self, node): letter = term[-i] if letter != 46: # letter != b'.' dim = shape[-i] - if letter not in letter_to_dim.keys(): - letter_to_dim[letter] = dim - elif type(dim) != sympy.Symbol: + if letter not in letter_to_dim or type(dim) != sympy.Symbol: letter_to_dim[letter] = dim num_operands = num_operands + 1 @@ -1121,7 +1091,7 @@ def _infer_Gather(self, node): if ( node.input[0] in self.sympy_data_ and len(data_shape) == 1 - and 0 == get_attribute(node, "axis", 0) + and get_attribute(node, "axis", 0) == 0 ): idx = self._try_get_value(node, 1) if idx is not None: @@ -1191,11 +1161,14 @@ def _infer_If(self, node): ) # pass on sympy data from subgraph, if cond is constant - if cond is not None and i_sub == (0 if as_scalar(cond) > 0 else 1): - if subgraph.output[i_out].name in subgraph_infer.sympy_data_: - self.sympy_data_[vi.name] = subgraph_infer.sympy_data_[ - subgraph.output[i_out].name - ] + if ( + cond is not None + and i_sub == (0 if as_scalar(cond) > 0 else 1) + and subgraph.output[i_out].name in subgraph_infer.sympy_data_ + ): + self.sympy_data_[vi.name] = subgraph_infer.sympy_data_[ + subgraph.output[i_out].name + ] def _infer_Loop(self, node): subgraph = get_attribute(node, "body") @@ -1231,7 +1204,7 @@ def _infer_Loop(self, node): else: si = subgraph.input[i_out + 1] si_shape = get_shape_from_value_info(si) - for di, dims in enumerate(zip(si_shape, so_shape)): + for di, dims in enumerate(zip(si_shape, so_shape, strict=False)): if dims[0] != dims[1]: new_dim = onnx.TensorShapeProto.Dimension() new_dim.dim_param = str( @@ -1244,9 +1217,7 @@ def _infer_Loop(self, node): if need_second_infer: if self.verbose_ > 2: logger.debug( - "Rerun Loop: {}({}...), because of sequence in loop carried variables".format( - node.name, node.output[0] - ) + f"Rerun Loop: {node.name}({node.output[0]}...), because of sequence in loop carried variables" ) self._onnx_infer_subgraph(node, subgraph, inc_subgraph_id=False) @@ -1300,15 +1271,13 @@ def _infer_OneHot(self, node): axis = get_attribute(node, "axis", -1) axis = handle_negative_axis(axis, len(sympy_shape) + 1) new_shape = get_shape_from_sympy_shape( - sympy_shape[:axis] - + [ - ( - self._new_symbolic_dim_from_output(node) - if not is_literal(depth) - else depth - ) + [ + *sympy_shape[:axis], + self._new_symbolic_dim_from_output(node) + if not is_literal(depth) + else depth, + *sympy_shape[axis:], ] - + sympy_shape[axis:] ) vi = self.known_vi_[node.output[0]] vi.CopyFrom( @@ -1332,7 +1301,9 @@ def _infer_Pad(self, node): assert len(pads) == 2 * rank new_sympy_shape = [ d + pad_up + pad_down - for d, pad_up, pad_down in zip(sympy_shape, pads[:rank], pads[rank:]) + for d, pad_up, pad_down in zip( + sympy_shape, pads[:rank], pads[rank:], strict=False + ) ] self._update_computed_dims(new_sympy_shape) else: @@ -1414,12 +1385,8 @@ def _infer_aten_multinomial(self, node): assert rank in [1, 2] num_samples = self._try_get_value(node, 1) di = rank - 1 - last_dim = ( - num_samples - if num_samples - else str(self._new_symbolic_dim_from_output(node, 0, di)) - ) - output_shape = sympy_shape[:-1] + [last_dim] + last_dim = num_samples or str(self._new_symbolic_dim_from_output(node, 0, di)) + output_shape = [*sympy_shape[:-1], last_dim] vi = self.known_vi_[node.output[0]] vi.CopyFrom( helper.make_tensor_value_info( @@ -1533,7 +1500,7 @@ def _infer_BatchNormalization(self, node): def _infer_Range(self, node): vi = self.known_vi_[node.output[0]] input_data = self._get_int_values(node) - if all([i is not None for i in input_data]): + if all(i is not None for i in input_data): start = as_scalar(input_data[0]) limit = as_scalar(input_data[1]) delta = as_scalar(input_data[2]) @@ -1613,12 +1580,12 @@ def _infer_Reshape(self, node): ) else: input_sympy_shape = self._get_sympy_shape(node, 0) - total = int(1) + total = 1 for d in input_sympy_shape: total = total * d new_sympy_shape = [] deferred_dim_idx = -1 - non_deferred_size = int(1) + non_deferred_size = 1 for i, d in enumerate(shape_value): if type(d) == sympy.Symbol: new_sympy_shape.append(d) @@ -1656,7 +1623,7 @@ def _infer_Resize(self, node): if scales is not None: new_sympy_shape = [ sympy.simplify(sympy.floor(d * s)) - for d, s in zip(input_sympy_shape, scales) + for d, s in zip(input_sympy_shape, scales, strict=False) ] self._update_computed_dims(new_sympy_shape) vi.CopyFrom( @@ -1689,7 +1656,7 @@ def _infer_Resize(self, node): new_sympy_shape = [ sympy.simplify(sympy.floor(d * (end - start) * scale)) for d, start, end, scale in zip( - input_sympy_shape, roi_start, roi_end, scales + input_sympy_shape, roi_start, roi_end, scales, strict=False ) ] self._update_computed_dims(new_sympy_shape) @@ -1743,7 +1710,7 @@ def _infer_Scan(self, node): new_dim = handle_negative_axis( scan_output_axes[i - num_scan_states], len(shape) + 1 ) - shape = shape[:new_dim] + [scan_input_dim] + shape[new_dim:] + shape = [*shape[:new_dim], scan_input_dim, *shape[new_dim:]] vi.CopyFrom( helper.make_tensor_value_info( o, subgraph.output[i].type.tensor_type.elem_type, shape @@ -1824,7 +1791,7 @@ def handle_negative_index(index, bound): return index return bound + index except TypeError: - logger.warning("Cannot determine if {} < 0".format(index)) + logger.warning(f"Cannot determine if {index} < 0") return index if get_opset(self.out_mp_) <= 9: @@ -1840,7 +1807,7 @@ def handle_negative_index(index, bound): axes = self._try_get_value(node, 3) steps = self._try_get_value(node, 4) if axes is None and not (starts is None and ends is None): - axes = list(range(0, len(starts if starts is not None else ends))) + axes = list(range(len(starts if starts is not None else ends))) if steps is None and not (starts is None and ends is None): steps = [1] * len(starts if starts is not None else ends) axes = as_list(axes, keep_none=True) @@ -1856,7 +1823,7 @@ def handle_negative_index(index, bound): for i in axes: new_sympy_shape[i] = self._new_symbolic_dim_from_output(node, 0, i) else: - for i, s, e, t in zip(axes, starts, ends, steps): + for i, s, e, t in zip(axes, starts, ends, steps, strict=False): e = handle_negative_index(e, new_sympy_shape[i]) if is_literal(e): if e >= self.int_max_: @@ -1881,9 +1848,7 @@ def handle_negative_index(index, bound): e = new_sympy_shape[i] except Exception: logger.warning( - "Unable to determine if {} <= {}, treat as equal".format( - e, new_sympy_shape[i] - ) + f"Unable to determine if {e} <= {new_sympy_shape[i]}, treat as equal" ) e = new_sympy_shape[i] @@ -1909,7 +1874,7 @@ def handle_negative_index(index, bound): # handle sympy_data if needed, for slice in shape computation if ( node.input[0] in self.sympy_data_ - and [0] == axes + and axes == [0] and len(starts) == 1 and len(ends) == 1 and len(steps) == 1 @@ -1954,9 +1919,11 @@ def _infer_Split_Common(self, node, make_value_info_func): node.output[i_o], self.known_vi_[node.input[0]].type.tensor_type.elem_type, get_shape_from_sympy_shape( - input_sympy_shape[:axis] - + [split[i_o]] - + input_sympy_shape[axis + 1 :] + [ + *input_sympy_shape[:axis], + split[i_o], + *input_sympy_shape[axis + 1 :], + ] ), ) ) @@ -2048,10 +2015,7 @@ def _infer_TopK(self, node): else: k = self._get_int_values(node)[1] - if k is None: - k = self._new_symbolic_dim_from_output(node) - else: - k = as_scalar(k) + k = self._new_symbolic_dim_from_output(node) if k is None else as_scalar(k) if type(k) in [int, str]: new_shape[axis] = k @@ -2129,9 +2093,7 @@ def _infer_ZipMap(self, node): assert map_key_type is not None new_vi = onnx.ValueInfoProto() new_vi.name = node.output[0] - new_vi.type.sequence_type.elem_type.map_type.value_type.tensor_type.elem_type = ( - onnx.TensorProto.FLOAT - ) + new_vi.type.sequence_type.elem_type.map_type.value_type.tensor_type.elem_type = onnx.TensorProto.FLOAT new_vi.type.sequence_type.elem_type.map_type.key_type = map_key_type vi = self.known_vi_[node.output[0]] vi.CopyFrom(new_vi) @@ -2189,7 +2151,7 @@ def _infer_EmbedLayerNormalization(self, node): input_ids_shape = self._get_shape(node, 0) word_embedding_shape = self._get_shape(node, 2) assert len(input_ids_shape) == 2 and len(word_embedding_shape) == 2 - output_shape = input_ids_shape + [word_embedding_shape[1]] + output_shape = [*input_ids_shape, word_embedding_shape[1]] word_embedding_dtype = self.known_vi_[node.input[2]].type.tensor_type.elem_type vi = self.known_vi_[node.output[0]] @@ -2262,9 +2224,7 @@ def _is_none_dim(self, dim_value): return False if "unk__" not in dim_value: return False - if dim_value in self.symbolic_dims_.keys(): - return False - return True + return dim_value not in self.symbolic_dims_ def _is_shape_contains_none_dim(self, out_shape): for out in out_shape: @@ -2313,14 +2273,12 @@ def _infer_impl(self, start_sympy_data=None): # compute prerequesite for node for topological sort # node with subgraphs may have dependency on implicit inputs, which will affect topological sort - prereq_for_node = ( - {} - ) # map from node to all its inputs, including implicit ones in subgraph + prereq_for_node = {} # map from node to all its inputs, including implicit ones in subgraph def get_prereq(node): - names = set(i for i in node.input if i) + names = {i for i in node.input if i} subgraphs = [] - if "If" == node.op_type: + if node.op_type == "If": subgraphs = [ get_attribute(node, "then_branch"), get_attribute(node, "else_branch"), @@ -2343,8 +2301,7 @@ def get_prereq(node): names.update(g_prereq) # remove subgraph inputs from g_prereq since those are local-only for i in g.input: - if i.name in names: - names.remove(i.name) + names.discard(i.name) return names for n in self.tmp_mp_.graph.node: @@ -2352,43 +2309,37 @@ def get_prereq(node): # topological sort nodes, note there might be dead nodes so we check if all graph outputs are reached to terminate sorted_nodes = [] - sorted_known_vi = set( - [ - i.name - for i in list(self.out_mp_.graph.input) - + list(self.out_mp_.graph.initializer) - ] - ) - if any([o.name in sorted_known_vi for o in self.out_mp_.graph.output]): + sorted_known_vi = { + i.name + for i in list(self.out_mp_.graph.input) + + list(self.out_mp_.graph.initializer) + } + if any(o.name in sorted_known_vi for o in self.out_mp_.graph.output): # Loop/Scan will have some graph output in graph inputs, so don't do topological sort sorted_nodes = self.out_mp_.graph.node else: - while not all( - [o.name in sorted_known_vi for o in self.out_mp_.graph.output] - ): + while not all(o.name in sorted_known_vi for o in self.out_mp_.graph.output): old_sorted_nodes_len = len(sorted_nodes) for node in self.out_mp_.graph.node: if (node.output[0] not in sorted_known_vi) and all( - [ - i in sorted_known_vi - for i in prereq_for_node[node.output[0]] - if i - ] + i in sorted_known_vi + for i in prereq_for_node[node.output[0]] + if i ): sorted_known_vi.update(node.output) sorted_nodes.append(node) if old_sorted_nodes_len == len(sorted_nodes) and not all( - [o.name in sorted_known_vi for o in self.out_mp_.graph.output] + o.name in sorted_known_vi for o in self.out_mp_.graph.output ): raise Exception("Invalid model with cyclic graph") for node in sorted_nodes: - assert all([i in self.known_vi_ for i in node.input if i]) + assert all(i in self.known_vi_ for i in node.input if i) self._onnx_infer_single_node(node) known_aten_op = False if node.op_type in self.dispatcher_: self.dispatcher_[node.op_type](node) - elif node.op_type in ["ConvTranspose"]: + elif node.op_type == "ConvTranspose": # onnx shape inference ops like ConvTranspose may have empty shape for symbolic input # before adding symbolic compute for them # mark the output type as UNDEFINED to allow guessing of rank @@ -2463,7 +2414,7 @@ def get_prereq(node): seq_cls_type = out_type.sequence_type.elem_type.WhichOneof( "value" ) - if "tensor_type" == seq_cls_type: + if seq_cls_type == "tensor_type": logger.debug( " {}: sequence of {} {}".format( node.output[i_o], @@ -2475,14 +2426,10 @@ def get_prereq(node): ) else: logger.debug( - " {}: sequence of {}".format( - node.output[i_o], seq_cls_type - ) + f" {node.output[i_o]}: sequence of {seq_cls_type}" ) else: - logger.debug( - " {}: {}".format(node.output[i_o], out_type_kind) - ) + logger.debug(f" {node.output[i_o]}: {out_type_kind}") continue out_shape = get_shape_from_value_info(vi) @@ -2536,29 +2483,28 @@ def get_prereq(node): "MatMul", "MatMulInteger", "MatMulInteger16", - ]: - if ( - None in out_shape - or self._is_shape_contains_none_dim(out_shape) - ): - if None in out_shape: - idx = out_shape.index(None) - else: - idx = out_shape.index( - self._is_shape_contains_none_dim(out_shape) - ) - dim_idx = [ - len(s) - len(out_shape) + idx for s in shapes - ] - # only support auto merge for MatMul for dim < rank-2 when rank > 2 - assert ( - len(shapes[0]) > 2 - and dim_idx[0] < len(shapes[0]) - 2 - ) - assert ( - len(shapes[1]) > 2 - and dim_idx[1] < len(shapes[1]) - 2 + ] and ( + None in out_shape + or self._is_shape_contains_none_dim(out_shape) + ): + if None in out_shape: + idx = out_shape.index(None) + else: + idx = out_shape.index( + self._is_shape_contains_none_dim(out_shape) ) + dim_idx = [ + len(s) - len(out_shape) + idx for s in shapes + ] + # only support auto merge for MatMul for dim < rank-2 when rank > 2 + assert ( + len(shapes[0]) > 2 + and dim_idx[0] < len(shapes[0]) - 2 + ) + assert ( + len(shapes[1]) > 2 + and dim_idx[1] < len(shapes[1]) - 2 + ) elif node.op_type == "Expand": # auto merge for cases like Expand([min(batch, 1), min(seq, 512)], [batch, seq]) shapes = [ @@ -2583,7 +2529,9 @@ def get_prereq(node): self._add_suggested_merge( [ s[i] if is_literal(s[i]) else str(s[i]) - for s, i in zip(shapes, dim_idx) + for s, i in zip( + shapes, dim_idx, strict=False + ) if i >= 0 ] ) @@ -2635,17 +2583,11 @@ def get_prereq(node): if self.verbose_ > 0: if is_unknown_op: logger.debug( - "Possible unknown op: {} node: {}, guessing {} shape".format( - node.op_type, node.name, vi.name - ) + f"Possible unknown op: {node.op_type} node: {node.name}, guessing {vi.name} shape" ) if self.verbose_ > 2: logger.debug( - " {}: {} {}".format( - node.output[i_o], - str(new_shape), - vi.type.tensor_type.elem_type, - ) + f" {node.output[i_o]}: {new_shape!s} {vi.type.tensor_type.elem_type}" ) self.run_ = True diff --git a/tools/onnx/prune_onnx_model.py b/tools/onnx/prune_onnx_model.py index 32712093a..47c37ed68 100755 --- a/tools/onnx/prune_onnx_model.py +++ b/tools/onnx/prune_onnx_model.py @@ -43,9 +43,7 @@ def parse_arguments(): for output_name in args.output_names: if output_name not in output_tensor_names: print( - "[ERROR] Cannot find output tensor name '{}' in onnx model graph.".format( - output_name - ) + f"[ERROR] Cannot find output tensor name '{output_name}' in onnx model graph." ) sys.exit(-1) if len(set(args.output_names)) < len(args.output_names): @@ -55,7 +53,7 @@ def parse_arguments(): sys.exit(-1) output_node_indices = set() - output_to_node = dict() + output_to_node = {} for i, node in enumerate(model.graph.node): for out in node.output: output_to_node[out] = i @@ -91,7 +89,7 @@ def parse_arguments(): del model.graph.input[idx] for out in args.output_names: model.graph.output.extend([onnx.ValueInfoProto(name=out)]) - for i in range(num_outputs): + for _i in range(num_outputs): del model.graph.output[0] from onnx_infer_shape import SymbolicShapeInference @@ -99,14 +97,10 @@ def parse_arguments(): model = SymbolicShapeInference.infer_shapes(model, 2**31 - 1, True, False, 1) onnx.checker.check_model(model) onnx.save(model, args.save_file) - print("[Finished] The new model saved in {}.".format(args.save_file)) + print(f"[Finished] The new model saved in {args.save_file}.") print( - "[DEBUG INFO] The inputs of new model: {}".format( - [x.name for x in model.graph.input] - ) + f"[DEBUG INFO] The inputs of new model: {[x.name for x in model.graph.input]}" ) print( - "[DEBUG INFO] The outputs of new model: {}".format( - [x.name for x in model.graph.output] - ) + f"[DEBUG INFO] The outputs of new model: {[x.name for x in model.graph.output]}" ) diff --git a/tools/onnx/rename_onnx_model.py b/tools/onnx/rename_onnx_model.py index 9fbc2631a..6108883b4 100755 --- a/tools/onnx/rename_onnx_model.py +++ b/tools/onnx/rename_onnx_model.py @@ -54,9 +54,7 @@ def parse_arguments(): for origin_name in args.origin_names: if origin_name not in output_tensor_names: print( - "[ERROR] Cannot find tensor name '{}' in onnx model graph.".format( - origin_name - ) + f"[ERROR] Cannot find tensor name '{origin_name}' in onnx model graph." ) sys.exit(-1) if len(set(args.origin_names)) < len(args.origin_names): @@ -101,14 +99,10 @@ def parse_arguments(): onnx.checker.check_model(model) onnx.save(model, args.save_file) - print("[Finished] The new model saved in {}.".format(args.save_file)) + print(f"[Finished] The new model saved in {args.save_file}.") print( - "[DEBUG INFO] The inputs of new model: {}".format( - [x.name for x in model.graph.input] - ) + f"[DEBUG INFO] The inputs of new model: {[x.name for x in model.graph.input]}" ) print( - "[DEBUG INFO] The outputs of new model: {}".format( - [x.name for x in model.graph.output] - ) + f"[DEBUG INFO] The outputs of new model: {[x.name for x in model.graph.output]}" ) diff --git a/tools/paddle/infer_paddle_model_shape.py b/tools/paddle/infer_paddle_model_shape.py index 6afd45b49..cae58921a 100755 --- a/tools/paddle/infer_paddle_model_shape.py +++ b/tools/paddle/infer_paddle_model_shape.py @@ -13,6 +13,7 @@ # limitations under the License. import argparse + import paddle import paddle.base as base import paddle.static as static @@ -20,9 +21,10 @@ def process_old_ops_desc(program): for i in range(len(program.blocks[0].ops)): - if program.blocks[0].ops[i].type == "matmul": - if not program.blocks[0].ops[i].has_attr("head_number"): - program.blocks[0].ops[i]._set_attr("head_number", 1) + if program.blocks[0].ops[i].type == "matmul" and not program.blocks[0].ops[ + i + ].has_attr("head_number"): + program.blocks[0].ops[i]._set_attr("head_number", 1) def infer_shape(program, input_shape_dict): @@ -65,12 +67,10 @@ def infer_shape(program, input_shape_dict): major_ver = model_version // 1000000 minor_ver = (model_version - major_ver * 1000000) // 1000 patch_ver = model_version - major_ver * 1000000 - minor_ver * 1000 - model_version = "{}.{}.{}".format(major_ver, minor_ver, patch_ver) + model_version = f"{major_ver}.{minor_ver}.{patch_ver}" if model_version != paddle_version: print( - "[WARNING] The model is saved by paddlepaddle v{}, but now your paddlepaddle is version of {}, this difference may cause error, it is recommend you reinstall a same version of paddlepaddle for this model".format( - model_version, paddle_version - ) + f"[WARNING] The model is saved by paddlepaddle v{model_version}, but now your paddlepaddle is version of {paddle_version}, this difference may cause error, it is recommend you reinstall a same version of paddlepaddle for this model" ) for k, v in input_shape_dict.items(): program.blocks[0].var(k).desc.set_shape(v) diff --git a/tools/paddle/merge_params.py b/tools/paddle/merge_params.py index 80d84539a..e3ee852fb 100755 --- a/tools/paddle/merge_params.py +++ b/tools/paddle/merge_params.py @@ -12,8 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle.fluid as fluid import sys + +import paddle.fluid as fluid + import paddle paddle.enable_static() diff --git a/tools/paddle/prune_paddle_model.py b/tools/paddle/prune_paddle_model.py index f259816a7..4987ff4a3 100755 --- a/tools/paddle/prune_paddle_model.py +++ b/tools/paddle/prune_paddle_model.py @@ -13,11 +13,12 @@ # limitations under the License. import argparse +import os import sys + import paddle import paddle.base.core as core import paddle.static as static -import os def prepend_feed_ops(program, feed_target_names): @@ -32,9 +33,7 @@ def prepend_feed_ops(program, feed_target_names): for i, name in enumerate(feed_target_names): if not global_block.has_var(name): print( - "The input[{i}]: '{name}' doesn't exist in pruned inference program, which will be ignored in new saved model.".format( - i=i, name=name - ) + f"The input[{i}]: '{name}' doesn't exist in pruned inference program, which will be ignored in new saved model." ) continue out = global_block.var(name) @@ -54,7 +53,7 @@ def append_fetch_ops(program, fetch_target_names): fetch_var = global_block.create_var( name="fetch", type=core.VarDesc.VarType.FETCH_LIST, persistable=True ) - print("the len of fetch_target_names:%d" % (len(fetch_target_names))) + print(f"the len of fetch_target_names:{len(fetch_target_names)}") for i, name in enumerate(fetch_target_names): global_block.append_op( type="fetch", @@ -66,7 +65,7 @@ def append_fetch_ops(program, fetch_target_names): def insert_by_op_type(program, op_names, op_type): global_block = program.global_block() - need_to_remove_op_index = list() + need_to_remove_op_index = [] for i, op in enumerate(global_block.ops): if op.type == op_type: need_to_remove_op_index.append(i) @@ -133,7 +132,7 @@ def parse_arguments(): program.global_block().var(out_name) for out_name in args.output_names ] else: - fetch_vars = [out_var for out_var in fetch_targets] + fetch_vars = list(fetch_targets) model_name = args.model_filename.split(".")[0] path_prefix = os.path.join(args.save_dir, model_name) diff --git a/uv.lock b/uv.lock new file mode 100644 index 000000000..3e5a32c14 --- /dev/null +++ b/uv.lock @@ -0,0 +1,1001 @@ +version = 1 +revision = 3 +requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.13'", + "python_full_version == '3.12.*'", + "python_full_version == '3.11.*'", + "python_full_version < '3.11'", +] + +[[package]] +name = "anyio" +version = "4.12.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703", size = 228685, upload-time = "2026-01-06T11:45:21.246Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/38/0e/27be9fdef66e72d64c0cdc3cc2823101b80585f8119b5c112c2e8f5f7dab/anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c", size = 113592, upload-time = "2026-01-06T11:45:19.497Z" }, +] + +[[package]] +name = "certifi" +version = "2026.2.25" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/af/2d/7bf41579a8986e348fa033a31cdd0e4121114f6bce2457e8876010b092dd/certifi-2026.2.25.tar.gz", hash = "sha256:e887ab5cee78ea814d3472169153c2d12cd43b14bd03329a39a9c6e2e80bfba7", size = 155029, upload-time = "2026-02-25T02:54:17.342Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9a/3c/c17fb3ca2d9c3acff52e30b309f538586f9f5b9c9cf454f3845fc9af4881/certifi-2026.2.25-py3-none-any.whl", hash = "sha256:027692e4402ad994f1c42e52a4997a9763c646b73e4096e4d5d6db8af1d6f0fa", size = 153684, upload-time = "2026-02-25T02:54:15.766Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.12'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "flatbuffers" +version = "25.12.19" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e8/2d/d2a548598be01649e2d46231d151a6c56d10b964d94043a335ae56ea2d92/flatbuffers-25.12.19-py2.py3-none-any.whl", hash = "sha256:7634f50c427838bb021c2d66a3d1168e9d199b0607e6329399f04846d42e20b4", size = 26661, upload-time = "2025-12-19T23:16:13.622Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "hypothesis" +version = "6.151.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "sortedcontainers" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/19/e1/ef365ff480903b929d28e057f57b76cae51a30375943e33374ec9a165d9c/hypothesis-6.151.9.tar.gz", hash = "sha256:2f284428dda6c3c48c580de0e18470ff9c7f5ef628a647ee8002f38c3f9097ca", size = 463534, upload-time = "2026-02-16T22:59:23.09Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c4/f7/5cc291d701094754a1d327b44d80a44971e13962881d9a400235726171da/hypothesis-6.151.9-py3-none-any.whl", hash = "sha256:7b7220585c67759b1b1ef839b1e6e9e3d82ed468cfc1ece43c67184848d7edd9", size = 529307, upload-time = "2026-02-16T22:59:20.443Z" }, +] + +[[package]] +name = "idna" +version = "3.11" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "librt" +version = "0.8.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/56/9c/b4b0c54d84da4a94b37bd44151e46d5e583c9534c7e02250b961b1b6d8a8/librt-0.8.1.tar.gz", hash = "sha256:be46a14693955b3bd96014ccbdb8339ee8c9346fbe11c1b78901b55125f14c73", size = 177471, upload-time = "2026-02-17T16:13:06.101Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7c/5f/63f5fa395c7a8a93558c0904ba8f1c8d1b997ca6a3de61bc7659970d66bf/librt-0.8.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:81fd938344fecb9373ba1b155968c8a329491d2ce38e7ddb76f30ffb938f12dc", size = 65697, upload-time = "2026-02-17T16:11:06.903Z" }, + { url = "https://files.pythonhosted.org/packages/ff/e0/0472cf37267b5920eff2f292ccfaede1886288ce35b7f3203d8de00abfe6/librt-0.8.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5db05697c82b3a2ec53f6e72b2ed373132b0c2e05135f0696784e97d7f5d48e7", size = 68376, upload-time = "2026-02-17T16:11:08.395Z" }, + { url = "https://files.pythonhosted.org/packages/c8/be/8bd1359fdcd27ab897cd5963294fa4a7c83b20a8564678e4fd12157e56a5/librt-0.8.1-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:d56bc4011975f7460bea7b33e1ff425d2f1adf419935ff6707273c77f8a4ada6", size = 197084, upload-time = "2026-02-17T16:11:09.774Z" }, + { url = "https://files.pythonhosted.org/packages/e2/fe/163e33fdd091d0c2b102f8a60cc0a61fd730ad44e32617cd161e7cd67a01/librt-0.8.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5cdc0f588ff4b663ea96c26d2a230c525c6fc62b28314edaaaca8ed5af931ad0", size = 207337, upload-time = "2026-02-17T16:11:11.311Z" }, + { url = "https://files.pythonhosted.org/packages/01/99/f85130582f05dcf0c8902f3d629270231d2f4afdfc567f8305a952ac7f14/librt-0.8.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:97c2b54ff6717a7a563b72627990bec60d8029df17df423f0ed37d56a17a176b", size = 219980, upload-time = "2026-02-17T16:11:12.499Z" }, + { url = "https://files.pythonhosted.org/packages/6f/54/cb5e4d03659e043a26c74e08206412ac9a3742f0477d96f9761a55313b5f/librt-0.8.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8f1125e6bbf2f1657d9a2f3ccc4a2c9b0c8b176965bb565dd4d86be67eddb4b6", size = 212921, upload-time = "2026-02-17T16:11:14.484Z" }, + { url = "https://files.pythonhosted.org/packages/b1/81/a3a01e4240579c30f3487f6fed01eb4bc8ef0616da5b4ebac27ca19775f3/librt-0.8.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:8f4bb453f408137d7581be309b2fbc6868a80e7ef60c88e689078ee3a296ae71", size = 221381, upload-time = "2026-02-17T16:11:17.459Z" }, + { url = "https://files.pythonhosted.org/packages/08/b0/fc2d54b4b1c6fb81e77288ff31ff25a2c1e62eaef4424a984f228839717b/librt-0.8.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:c336d61d2fe74a3195edc1646d53ff1cddd3a9600b09fa6ab75e5514ba4862a7", size = 216714, upload-time = "2026-02-17T16:11:19.197Z" }, + { url = "https://files.pythonhosted.org/packages/96/96/85daa73ffbd87e1fb287d7af6553ada66bf25a2a6b0de4764344a05469f6/librt-0.8.1-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:eb5656019db7c4deacf0c1a55a898c5bb8f989be904597fcb5232a2f4828fa05", size = 214777, upload-time = "2026-02-17T16:11:20.443Z" }, + { url = "https://files.pythonhosted.org/packages/12/9c/c3aa7a2360383f4bf4f04d98195f2739a579128720c603f4807f006a4225/librt-0.8.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c25d9e338d5bed46c1632f851babf3d13c78f49a225462017cf5e11e845c5891", size = 237398, upload-time = "2026-02-17T16:11:22.083Z" }, + { url = "https://files.pythonhosted.org/packages/61/19/d350ea89e5274665185dabc4bbb9c3536c3411f862881d316c8b8e00eb66/librt-0.8.1-cp310-cp310-win32.whl", hash = "sha256:aaab0e307e344cb28d800957ef3ec16605146ef0e59e059a60a176d19543d1b7", size = 54285, upload-time = "2026-02-17T16:11:23.27Z" }, + { url = "https://files.pythonhosted.org/packages/4f/d6/45d587d3d41c112e9543a0093d883eb57a24a03e41561c127818aa2a6bcc/librt-0.8.1-cp310-cp310-win_amd64.whl", hash = "sha256:56e04c14b696300d47b3bc5f1d10a00e86ae978886d0cee14e5714fafb5df5d2", size = 61352, upload-time = "2026-02-17T16:11:24.207Z" }, + { url = "https://files.pythonhosted.org/packages/1d/01/0e748af5e4fee180cf7cd12bd12b0513ad23b045dccb2a83191bde82d168/librt-0.8.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:681dc2451d6d846794a828c16c22dc452d924e9f700a485b7ecb887a30aad1fd", size = 65315, upload-time = "2026-02-17T16:11:25.152Z" }, + { url = "https://files.pythonhosted.org/packages/9d/4d/7184806efda571887c798d573ca4134c80ac8642dcdd32f12c31b939c595/librt-0.8.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a3b4350b13cc0e6f5bec8fa7caf29a8fb8cdc051a3bae45cfbfd7ce64f009965", size = 68021, upload-time = "2026-02-17T16:11:26.129Z" }, + { url = "https://files.pythonhosted.org/packages/ae/88/c3c52d2a5d5101f28d3dc89298444626e7874aa904eed498464c2af17627/librt-0.8.1-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:ac1e7817fd0ed3d14fd7c5df91daed84c48e4c2a11ee99c0547f9f62fdae13da", size = 194500, upload-time = "2026-02-17T16:11:27.177Z" }, + { url = "https://files.pythonhosted.org/packages/d6/5d/6fb0a25b6a8906e85b2c3b87bee1d6ed31510be7605b06772f9374ca5cb3/librt-0.8.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:747328be0c5b7075cde86a0e09d7a9196029800ba75a1689332348e998fb85c0", size = 205622, upload-time = "2026-02-17T16:11:28.242Z" }, + { url = "https://files.pythonhosted.org/packages/b2/a6/8006ae81227105476a45691f5831499e4d936b1c049b0c1feb17c11b02d1/librt-0.8.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f0af2bd2bc204fa27f3d6711d0f360e6b8c684a035206257a81673ab924aa11e", size = 218304, upload-time = "2026-02-17T16:11:29.344Z" }, + { url = "https://files.pythonhosted.org/packages/ee/19/60e07886ad16670aae57ef44dada41912c90906a6fe9f2b9abac21374748/librt-0.8.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d480de377f5b687b6b1bc0c0407426da556e2a757633cc7e4d2e1a057aa688f3", size = 211493, upload-time = "2026-02-17T16:11:30.445Z" }, + { url = "https://files.pythonhosted.org/packages/9c/cf/f666c89d0e861d05600438213feeb818c7514d3315bae3648b1fc145d2b6/librt-0.8.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d0ee06b5b5291f609ddb37b9750985b27bc567791bc87c76a569b3feed8481ac", size = 219129, upload-time = "2026-02-17T16:11:32.021Z" }, + { url = "https://files.pythonhosted.org/packages/8f/ef/f1bea01e40b4a879364c031476c82a0dc69ce068daad67ab96302fed2d45/librt-0.8.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:9e2c6f77b9ad48ce5603b83b7da9ee3e36b3ab425353f695cba13200c5d96596", size = 213113, upload-time = "2026-02-17T16:11:33.192Z" }, + { url = "https://files.pythonhosted.org/packages/9b/80/cdab544370cc6bc1b72ea369525f547a59e6938ef6863a11ab3cd24759af/librt-0.8.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:439352ba9373f11cb8e1933da194dcc6206daf779ff8df0ed69c5e39113e6a99", size = 212269, upload-time = "2026-02-17T16:11:34.373Z" }, + { url = "https://files.pythonhosted.org/packages/9d/9c/48d6ed8dac595654f15eceab2035131c136d1ae9a1e3548e777bb6dbb95d/librt-0.8.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:82210adabbc331dbb65d7868b105185464ef13f56f7f76688565ad79f648b0fe", size = 234673, upload-time = "2026-02-17T16:11:36.063Z" }, + { url = "https://files.pythonhosted.org/packages/16/01/35b68b1db517f27a01be4467593292eb5315def8900afad29fabf56304ba/librt-0.8.1-cp311-cp311-win32.whl", hash = "sha256:52c224e14614b750c0a6d97368e16804a98c684657c7518752c356834fff83bb", size = 54597, upload-time = "2026-02-17T16:11:37.544Z" }, + { url = "https://files.pythonhosted.org/packages/71/02/796fe8f02822235966693f257bf2c79f40e11337337a657a8cfebba5febc/librt-0.8.1-cp311-cp311-win_amd64.whl", hash = "sha256:c00e5c884f528c9932d278d5c9cbbea38a6b81eb62c02e06ae53751a83a4d52b", size = 61733, upload-time = "2026-02-17T16:11:38.691Z" }, + { url = "https://files.pythonhosted.org/packages/28/ad/232e13d61f879a42a4e7117d65e4984bb28371a34bb6fb9ca54ec2c8f54e/librt-0.8.1-cp311-cp311-win_arm64.whl", hash = "sha256:f7cdf7f26c2286ffb02e46d7bac56c94655540b26347673bea15fa52a6af17e9", size = 52273, upload-time = "2026-02-17T16:11:40.308Z" }, + { url = "https://files.pythonhosted.org/packages/95/21/d39b0a87ac52fc98f621fb6f8060efb017a767ebbbac2f99fbcbc9ddc0d7/librt-0.8.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a28f2612ab566b17f3698b0da021ff9960610301607c9a5e8eaca62f5e1c350a", size = 66516, upload-time = "2026-02-17T16:11:41.604Z" }, + { url = "https://files.pythonhosted.org/packages/69/f1/46375e71441c43e8ae335905e069f1c54febee63a146278bcee8782c84fd/librt-0.8.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:60a78b694c9aee2a0f1aaeaa7d101cf713e92e8423a941d2897f4fa37908dab9", size = 68634, upload-time = "2026-02-17T16:11:43.268Z" }, + { url = "https://files.pythonhosted.org/packages/0a/33/c510de7f93bf1fa19e13423a606d8189a02624a800710f6e6a0a0f0784b3/librt-0.8.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:758509ea3f1eba2a57558e7e98f4659d0ea7670bff49673b0dde18a3c7e6c0eb", size = 198941, upload-time = "2026-02-17T16:11:44.28Z" }, + { url = "https://files.pythonhosted.org/packages/dd/36/e725903416409a533d92398e88ce665476f275081d0d7d42f9c4951999e5/librt-0.8.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:039b9f2c506bd0ab0f8725aa5ba339c6f0cd19d3b514b50d134789809c24285d", size = 209991, upload-time = "2026-02-17T16:11:45.462Z" }, + { url = "https://files.pythonhosted.org/packages/30/7a/8d908a152e1875c9f8eac96c97a480df425e657cdb47854b9efaa4998889/librt-0.8.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5bb54f1205a3a6ab41a6fd71dfcdcbd278670d3a90ca502a30d9da583105b6f7", size = 224476, upload-time = "2026-02-17T16:11:46.542Z" }, + { url = "https://files.pythonhosted.org/packages/a8/b8/a22c34f2c485b8903a06f3fe3315341fe6876ef3599792344669db98fcff/librt-0.8.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:05bd41cdee35b0c59c259f870f6da532a2c5ca57db95b5f23689fcb5c9e42440", size = 217518, upload-time = "2026-02-17T16:11:47.746Z" }, + { url = "https://files.pythonhosted.org/packages/79/6f/5c6fea00357e4f82ba44f81dbfb027921f1ab10e320d4a64e1c408d035d9/librt-0.8.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:adfab487facf03f0d0857b8710cf82d0704a309d8ffc33b03d9302b4c64e91a9", size = 225116, upload-time = "2026-02-17T16:11:49.298Z" }, + { url = "https://files.pythonhosted.org/packages/f2/a0/95ced4e7b1267fe1e2720a111685bcddf0e781f7e9e0ce59d751c44dcfe5/librt-0.8.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:153188fe98a72f206042be10a2c6026139852805215ed9539186312d50a8e972", size = 217751, upload-time = "2026-02-17T16:11:50.49Z" }, + { url = "https://files.pythonhosted.org/packages/93/c2/0517281cb4d4101c27ab59472924e67f55e375bc46bedae94ac6dc6e1902/librt-0.8.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:dd3c41254ee98604b08bd5b3af5bf0a89740d4ee0711de95b65166bf44091921", size = 218378, upload-time = "2026-02-17T16:11:51.783Z" }, + { url = "https://files.pythonhosted.org/packages/43/e8/37b3ac108e8976888e559a7b227d0ceac03c384cfd3e7a1c2ee248dbae79/librt-0.8.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e0d138c7ae532908cbb342162b2611dbd4d90c941cd25ab82084aaf71d2c0bd0", size = 241199, upload-time = "2026-02-17T16:11:53.561Z" }, + { url = "https://files.pythonhosted.org/packages/4b/5b/35812d041c53967fedf551a39399271bbe4257e681236a2cf1a69c8e7fa1/librt-0.8.1-cp312-cp312-win32.whl", hash = "sha256:43353b943613c5d9c49a25aaffdba46f888ec354e71e3529a00cca3f04d66a7a", size = 54917, upload-time = "2026-02-17T16:11:54.758Z" }, + { url = "https://files.pythonhosted.org/packages/de/d1/fa5d5331b862b9775aaf2a100f5ef86854e5d4407f71bddf102f4421e034/librt-0.8.1-cp312-cp312-win_amd64.whl", hash = "sha256:ff8baf1f8d3f4b6b7257fcb75a501f2a5499d0dda57645baa09d4d0d34b19444", size = 62017, upload-time = "2026-02-17T16:11:55.748Z" }, + { url = "https://files.pythonhosted.org/packages/c7/7c/c614252f9acda59b01a66e2ddfd243ed1c7e1deab0293332dfbccf862808/librt-0.8.1-cp312-cp312-win_arm64.whl", hash = "sha256:0f2ae3725904f7377e11cc37722d5d401e8b3d5851fb9273d7f4fe04f6b3d37d", size = 52441, upload-time = "2026-02-17T16:11:56.801Z" }, + { url = "https://files.pythonhosted.org/packages/c5/3c/f614c8e4eaac7cbf2bbdf9528790b21d89e277ee20d57dc6e559c626105f/librt-0.8.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7e6bad1cd94f6764e1e21950542f818a09316645337fd5ab9a7acc45d99a8f35", size = 66529, upload-time = "2026-02-17T16:11:57.809Z" }, + { url = "https://files.pythonhosted.org/packages/ab/96/5836544a45100ae411eda07d29e3d99448e5258b6e9c8059deb92945f5c2/librt-0.8.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cf450f498c30af55551ba4f66b9123b7185362ec8b625a773b3d39aa1a717583", size = 68669, upload-time = "2026-02-17T16:11:58.843Z" }, + { url = "https://files.pythonhosted.org/packages/06/53/f0b992b57af6d5531bf4677d75c44f095f2366a1741fb695ee462ae04b05/librt-0.8.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:eca45e982fa074090057132e30585a7e8674e9e885d402eae85633e9f449ce6c", size = 199279, upload-time = "2026-02-17T16:11:59.862Z" }, + { url = "https://files.pythonhosted.org/packages/f3/ad/4848cc16e268d14280d8168aee4f31cea92bbd2b79ce33d3e166f2b4e4fc/librt-0.8.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0c3811485fccfda840861905b8c70bba5ec094e02825598bb9d4ca3936857a04", size = 210288, upload-time = "2026-02-17T16:12:00.954Z" }, + { url = "https://files.pythonhosted.org/packages/52/05/27fdc2e95de26273d83b96742d8d3b7345f2ea2bdbd2405cc504644f2096/librt-0.8.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e4af413908f77294605e28cfd98063f54b2c790561383971d2f52d113d9c363", size = 224809, upload-time = "2026-02-17T16:12:02.108Z" }, + { url = "https://files.pythonhosted.org/packages/7a/d0/78200a45ba3240cb042bc597d6f2accba9193a2c57d0356268cbbe2d0925/librt-0.8.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5212a5bd7fae98dae95710032902edcd2ec4dc994e883294f75c857b83f9aba0", size = 218075, upload-time = "2026-02-17T16:12:03.631Z" }, + { url = "https://files.pythonhosted.org/packages/af/72/a210839fa74c90474897124c064ffca07f8d4b347b6574d309686aae7ca6/librt-0.8.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e692aa2d1d604e6ca12d35e51fdc36f4cda6345e28e36374579f7ef3611b3012", size = 225486, upload-time = "2026-02-17T16:12:04.725Z" }, + { url = "https://files.pythonhosted.org/packages/a3/c1/a03cc63722339ddbf087485f253493e2b013039f5b707e8e6016141130fa/librt-0.8.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4be2a5c926b9770c9e08e717f05737a269b9d0ebc5d2f0060f0fe3fe9ce47acb", size = 218219, upload-time = "2026-02-17T16:12:05.828Z" }, + { url = "https://files.pythonhosted.org/packages/58/f5/fff6108af0acf941c6f274a946aea0e484bd10cd2dc37610287ce49388c5/librt-0.8.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:fd1a720332ea335ceb544cf0a03f81df92abd4bb887679fd1e460976b0e6214b", size = 218750, upload-time = "2026-02-17T16:12:07.09Z" }, + { url = "https://files.pythonhosted.org/packages/71/67/5a387bfef30ec1e4b4f30562c8586566faf87e47d696768c19feb49e3646/librt-0.8.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:93c2af9e01e0ef80d95ae3c720be101227edae5f2fe7e3dc63d8857fadfc5a1d", size = 241624, upload-time = "2026-02-17T16:12:08.43Z" }, + { url = "https://files.pythonhosted.org/packages/d4/be/24f8502db11d405232ac1162eb98069ca49c3306c1d75c6ccc61d9af8789/librt-0.8.1-cp313-cp313-win32.whl", hash = "sha256:086a32dbb71336627e78cc1d6ee305a68d038ef7d4c39aaff41ae8c9aa46e91a", size = 54969, upload-time = "2026-02-17T16:12:09.633Z" }, + { url = "https://files.pythonhosted.org/packages/5c/73/c9fdf6cb2a529c1a092ce769a12d88c8cca991194dfe641b6af12fa964d2/librt-0.8.1-cp313-cp313-win_amd64.whl", hash = "sha256:e11769a1dbda4da7b00a76cfffa67aa47cfa66921d2724539eee4b9ede780b79", size = 62000, upload-time = "2026-02-17T16:12:10.632Z" }, + { url = "https://files.pythonhosted.org/packages/d3/97/68f80ca3ac4924f250cdfa6e20142a803e5e50fca96ef5148c52ee8c10ea/librt-0.8.1-cp313-cp313-win_arm64.whl", hash = "sha256:924817ab3141aca17893386ee13261f1d100d1ef410d70afe4389f2359fea4f0", size = 52495, upload-time = "2026-02-17T16:12:11.633Z" }, + { url = "https://files.pythonhosted.org/packages/c9/6a/907ef6800f7bca71b525a05f1839b21f708c09043b1c6aa77b6b827b3996/librt-0.8.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:6cfa7fe54fd4d1f47130017351a959fe5804bda7a0bc7e07a2cdbc3fdd28d34f", size = 66081, upload-time = "2026-02-17T16:12:12.766Z" }, + { url = "https://files.pythonhosted.org/packages/1b/18/25e991cd5640c9fb0f8d91b18797b29066b792f17bf8493da183bf5caabe/librt-0.8.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:228c2409c079f8c11fb2e5d7b277077f694cb93443eb760e00b3b83cb8b3176c", size = 68309, upload-time = "2026-02-17T16:12:13.756Z" }, + { url = "https://files.pythonhosted.org/packages/a4/36/46820d03f058cfb5a9de5940640ba03165ed8aded69e0733c417bb04df34/librt-0.8.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7aae78ab5e3206181780e56912d1b9bb9f90a7249ce12f0e8bf531d0462dd0fc", size = 196804, upload-time = "2026-02-17T16:12:14.818Z" }, + { url = "https://files.pythonhosted.org/packages/59/18/5dd0d3b87b8ff9c061849fbdb347758d1f724b9a82241aa908e0ec54ccd0/librt-0.8.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:172d57ec04346b047ca6af181e1ea4858086c80bdf455f61994c4aa6fc3f866c", size = 206907, upload-time = "2026-02-17T16:12:16.513Z" }, + { url = "https://files.pythonhosted.org/packages/d1/96/ef04902aad1424fd7299b62d1890e803e6ab4018c3044dca5922319c4b97/librt-0.8.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6b1977c4ea97ce5eb7755a78fae68d87e4102e4aaf54985e8b56806849cc06a3", size = 221217, upload-time = "2026-02-17T16:12:17.906Z" }, + { url = "https://files.pythonhosted.org/packages/6d/ff/7e01f2dda84a8f5d280637a2e5827210a8acca9a567a54507ef1c75b342d/librt-0.8.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:10c42e1f6fd06733ef65ae7bebce2872bcafd8d6e6b0a08fe0a05a23b044fb14", size = 214622, upload-time = "2026-02-17T16:12:19.108Z" }, + { url = "https://files.pythonhosted.org/packages/1e/8c/5b093d08a13946034fed57619742f790faf77058558b14ca36a6e331161e/librt-0.8.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:4c8dfa264b9193c4ee19113c985c95f876fae5e51f731494fc4e0cf594990ba7", size = 221987, upload-time = "2026-02-17T16:12:20.331Z" }, + { url = "https://files.pythonhosted.org/packages/d3/cc/86b0b3b151d40920ad45a94ce0171dec1aebba8a9d72bb3fa00c73ab25dd/librt-0.8.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:01170b6729a438f0dedc4a26ed342e3dc4f02d1000b4b19f980e1877f0c297e6", size = 215132, upload-time = "2026-02-17T16:12:21.54Z" }, + { url = "https://files.pythonhosted.org/packages/fc/be/8588164a46edf1e69858d952654e216a9a91174688eeefb9efbb38a9c799/librt-0.8.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:7b02679a0d783bdae30d443025b94465d8c3dc512f32f5b5031f93f57ac32071", size = 215195, upload-time = "2026-02-17T16:12:23.073Z" }, + { url = "https://files.pythonhosted.org/packages/f5/f2/0b9279bea735c734d69344ecfe056c1ba211694a72df10f568745c899c76/librt-0.8.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:190b109bb69592a3401fe1ffdea41a2e73370ace2ffdc4a0e8e2b39cdea81b78", size = 237946, upload-time = "2026-02-17T16:12:24.275Z" }, + { url = "https://files.pythonhosted.org/packages/e9/cc/5f2a34fbc8aeb35314a3641f9956fa9051a947424652fad9882be7a97949/librt-0.8.1-cp314-cp314-win32.whl", hash = "sha256:e70a57ecf89a0f64c24e37f38d3fe217a58169d2fe6ed6d70554964042474023", size = 50689, upload-time = "2026-02-17T16:12:25.766Z" }, + { url = "https://files.pythonhosted.org/packages/a0/76/cd4d010ab2147339ca2b93e959c3686e964edc6de66ddacc935c325883d7/librt-0.8.1-cp314-cp314-win_amd64.whl", hash = "sha256:7e2f3edca35664499fbb36e4770650c4bd4a08abc1f4458eab9df4ec56389730", size = 57875, upload-time = "2026-02-17T16:12:27.465Z" }, + { url = "https://files.pythonhosted.org/packages/84/0f/2143cb3c3ca48bd3379dcd11817163ca50781927c4537345d608b5045998/librt-0.8.1-cp314-cp314-win_arm64.whl", hash = "sha256:0d2f82168e55ddefd27c01c654ce52379c0750ddc31ee86b4b266bcf4d65f2a3", size = 48058, upload-time = "2026-02-17T16:12:28.556Z" }, + { url = "https://files.pythonhosted.org/packages/d2/0e/9b23a87e37baf00311c3efe6b48d6b6c168c29902dfc3f04c338372fd7db/librt-0.8.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:2c74a2da57a094bd48d03fa5d196da83d2815678385d2978657499063709abe1", size = 68313, upload-time = "2026-02-17T16:12:29.659Z" }, + { url = "https://files.pythonhosted.org/packages/db/9a/859c41e5a4f1c84200a7d2b92f586aa27133c8243b6cac9926f6e54d01b9/librt-0.8.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a355d99c4c0d8e5b770313b8b247411ed40949ca44e33e46a4789b9293a907ee", size = 70994, upload-time = "2026-02-17T16:12:31.516Z" }, + { url = "https://files.pythonhosted.org/packages/4c/28/10605366ee599ed34223ac2bf66404c6fb59399f47108215d16d5ad751a8/librt-0.8.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2eb345e8b33fb748227409c9f1233d4df354d6e54091f0e8fc53acdb2ffedeb7", size = 220770, upload-time = "2026-02-17T16:12:33.294Z" }, + { url = "https://files.pythonhosted.org/packages/af/8d/16ed8fd452dafae9c48d17a6bc1ee3e818fd40ef718d149a8eff2c9f4ea2/librt-0.8.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9be2f15e53ce4e83cc08adc29b26fb5978db62ef2a366fbdf716c8a6c8901040", size = 235409, upload-time = "2026-02-17T16:12:35.443Z" }, + { url = "https://files.pythonhosted.org/packages/89/1b/7bdf3e49349c134b25db816e4a3db6b94a47ac69d7d46b1e682c2c4949be/librt-0.8.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:785ae29c1f5c6e7c2cde2c7c0e148147f4503da3abc5d44d482068da5322fd9e", size = 246473, upload-time = "2026-02-17T16:12:36.656Z" }, + { url = "https://files.pythonhosted.org/packages/4e/8a/91fab8e4fd2a24930a17188c7af5380eb27b203d72101c9cc000dbdfd95a/librt-0.8.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1d3a7da44baf692f0c6aeb5b2a09c5e6fc7a703bca9ffa337ddd2e2da53f7732", size = 238866, upload-time = "2026-02-17T16:12:37.849Z" }, + { url = "https://files.pythonhosted.org/packages/b9/e0/c45a098843fc7c07e18a7f8a24ca8496aecbf7bdcd54980c6ca1aaa79a8e/librt-0.8.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5fc48998000cbc39ec0d5311312dda93ecf92b39aaf184c5e817d5d440b29624", size = 250248, upload-time = "2026-02-17T16:12:39.445Z" }, + { url = "https://files.pythonhosted.org/packages/82/30/07627de23036640c952cce0c1fe78972e77d7d2f8fd54fa5ef4554ff4a56/librt-0.8.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:e96baa6820280077a78244b2e06e416480ed859bbd8e5d641cf5742919d8beb4", size = 240629, upload-time = "2026-02-17T16:12:40.889Z" }, + { url = "https://files.pythonhosted.org/packages/fb/c1/55bfe1ee3542eba055616f9098eaf6eddb966efb0ca0f44eaa4aba327307/librt-0.8.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:31362dbfe297b23590530007062c32c6f6176f6099646bb2c95ab1b00a57c382", size = 239615, upload-time = "2026-02-17T16:12:42.446Z" }, + { url = "https://files.pythonhosted.org/packages/2b/39/191d3d28abc26c9099b19852e6c99f7f6d400b82fa5a4e80291bd3803e19/librt-0.8.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cc3656283d11540ab0ea01978378e73e10002145117055e03722417aeab30994", size = 263001, upload-time = "2026-02-17T16:12:43.627Z" }, + { url = "https://files.pythonhosted.org/packages/b9/eb/7697f60fbe7042ab4e88f4ee6af496b7f222fffb0a4e3593ef1f29f81652/librt-0.8.1-cp314-cp314t-win32.whl", hash = "sha256:738f08021b3142c2918c03692608baed43bc51144c29e35807682f8070ee2a3a", size = 51328, upload-time = "2026-02-17T16:12:45.148Z" }, + { url = "https://files.pythonhosted.org/packages/7c/72/34bf2eb7a15414a23e5e70ecb9440c1d3179f393d9349338a91e2781c0fb/librt-0.8.1-cp314-cp314t-win_amd64.whl", hash = "sha256:89815a22daf9c51884fb5dbe4f1ef65ee6a146e0b6a8df05f753e2e4a9359bf4", size = 58722, upload-time = "2026-02-17T16:12:46.85Z" }, + { url = "https://files.pythonhosted.org/packages/b2/c8/d148e041732d631fc76036f8b30fae4e77b027a1e95b7a84bb522481a940/librt-0.8.1-cp314-cp314t-win_arm64.whl", hash = "sha256:bf512a71a23504ed08103a13c941f763db13fb11177beb3d9244c98c29fb4a61", size = 48755, upload-time = "2026-02-17T16:12:47.943Z" }, +] + +[[package]] +name = "ml-dtypes" +version = "0.5.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "numpy", version = "2.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0e/4a/c27b42ed9b1c7d13d9ba8b6905dece787d6259152f2309338aed29b2447b/ml_dtypes-0.5.4.tar.gz", hash = "sha256:8ab06a50fb9bf9666dd0fe5dfb4676fa2b0ac0f31ecff72a6c3af8e22c063453", size = 692314, upload-time = "2025-11-17T22:32:31.031Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fe/3a/c5b855752a70267ff729c349e650263adb3c206c29d28cc8ea7ace30a1d5/ml_dtypes-0.5.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b95e97e470fe60ed493fd9ae3911d8da4ebac16bd21f87ffa2b7c588bf22ea2c", size = 679735, upload-time = "2025-11-17T22:31:31.367Z" }, + { url = "https://files.pythonhosted.org/packages/41/79/7433f30ee04bd4faa303844048f55e1eb939131c8e5195a00a96a0939b64/ml_dtypes-0.5.4-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b4b801ebe0b477be666696bda493a9be8356f1f0057a57f1e35cd26928823e5a", size = 5051883, upload-time = "2025-11-17T22:31:33.658Z" }, + { url = "https://files.pythonhosted.org/packages/10/b1/8938e8830b0ee2e167fc75a094dea766a1152bde46752cd9bfc57ee78a82/ml_dtypes-0.5.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:388d399a2152dd79a3f0456a952284a99ee5c93d3e2f8dfe25977511e0515270", size = 5030369, upload-time = "2025-11-17T22:31:35.595Z" }, + { url = "https://files.pythonhosted.org/packages/c7/a3/51886727bd16e2f47587997b802dd56398692ce8c6c03c2e5bb32ecafe26/ml_dtypes-0.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:4ff7f3e7ca2972e7de850e7b8fcbb355304271e2933dd90814c1cb847414d6e2", size = 210738, upload-time = "2025-11-17T22:31:37.43Z" }, + { url = "https://files.pythonhosted.org/packages/c6/5e/712092cfe7e5eb667b8ad9ca7c54442f21ed7ca8979745f1000e24cf8737/ml_dtypes-0.5.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6c7ecb74c4bd71db68a6bea1edf8da8c34f3d9fe218f038814fd1d310ac76c90", size = 679734, upload-time = "2025-11-17T22:31:39.223Z" }, + { url = "https://files.pythonhosted.org/packages/4f/cf/912146dfd4b5c0eea956836c01dcd2fce6c9c844b2691f5152aca196ce4f/ml_dtypes-0.5.4-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bc11d7e8c44a65115d05e2ab9989d1e045125d7be8e05a071a48bc76eb6d6040", size = 5056165, upload-time = "2025-11-17T22:31:41.071Z" }, + { url = "https://files.pythonhosted.org/packages/a9/80/19189ea605017473660e43762dc853d2797984b3c7bf30ce656099add30c/ml_dtypes-0.5.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:19b9a53598f21e453ea2fbda8aa783c20faff8e1eeb0d7ab899309a0053f1483", size = 5034975, upload-time = "2025-11-17T22:31:42.758Z" }, + { url = "https://files.pythonhosted.org/packages/b4/24/70bd59276883fdd91600ca20040b41efd4902a923283c4d6edcb1de128d2/ml_dtypes-0.5.4-cp311-cp311-win_amd64.whl", hash = "sha256:7c23c54a00ae43edf48d44066a7ec31e05fdc2eee0be2b8b50dd1903a1db94bb", size = 210742, upload-time = "2025-11-17T22:31:44.068Z" }, + { url = "https://files.pythonhosted.org/packages/a0/c9/64230ef14e40aa3f1cb254ef623bf812735e6bec7772848d19131111ac0d/ml_dtypes-0.5.4-cp311-cp311-win_arm64.whl", hash = "sha256:557a31a390b7e9439056644cb80ed0735a6e3e3bb09d67fd5687e4b04238d1de", size = 160709, upload-time = "2025-11-17T22:31:46.557Z" }, + { url = "https://files.pythonhosted.org/packages/a8/b8/3c70881695e056f8a32f8b941126cf78775d9a4d7feba8abcb52cb7b04f2/ml_dtypes-0.5.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a174837a64f5b16cab6f368171a1a03a27936b31699d167684073ff1c4237dac", size = 676927, upload-time = "2025-11-17T22:31:48.182Z" }, + { url = "https://files.pythonhosted.org/packages/54/0f/428ef6881782e5ebb7eca459689448c0394fa0a80bea3aa9262cba5445ea/ml_dtypes-0.5.4-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a7f7c643e8b1320fd958bf098aa7ecf70623a42ec5154e3be3be673f4c34d900", size = 5028464, upload-time = "2025-11-17T22:31:50.135Z" }, + { url = "https://files.pythonhosted.org/packages/3a/cb/28ce52eb94390dda42599c98ea0204d74799e4d8047a0eb559b6fd648056/ml_dtypes-0.5.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9ad459e99793fa6e13bd5b7e6792c8f9190b4e5a1b45c63aba14a4d0a7f1d5ff", size = 5009002, upload-time = "2025-11-17T22:31:52.001Z" }, + { url = "https://files.pythonhosted.org/packages/f5/f0/0cfadd537c5470378b1b32bd859cf2824972174b51b873c9d95cfd7475a5/ml_dtypes-0.5.4-cp312-cp312-win_amd64.whl", hash = "sha256:c1a953995cccb9e25a4ae19e34316671e4e2edaebe4cf538229b1fc7109087b7", size = 212222, upload-time = "2025-11-17T22:31:53.742Z" }, + { url = "https://files.pythonhosted.org/packages/16/2e/9acc86985bfad8f2c2d30291b27cd2bb4c74cea08695bd540906ed744249/ml_dtypes-0.5.4-cp312-cp312-win_arm64.whl", hash = "sha256:9bad06436568442575beb2d03389aa7456c690a5b05892c471215bfd8cf39460", size = 160793, upload-time = "2025-11-17T22:31:55.358Z" }, + { url = "https://files.pythonhosted.org/packages/d9/a1/4008f14bbc616cfb1ac5b39ea485f9c63031c4634ab3f4cf72e7541f816a/ml_dtypes-0.5.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8c760d85a2f82e2bed75867079188c9d18dae2ee77c25a54d60e9cc79be1bc48", size = 676888, upload-time = "2025-11-17T22:31:56.907Z" }, + { url = "https://files.pythonhosted.org/packages/d3/b7/dff378afc2b0d5a7d6cd9d3209b60474d9819d1189d347521e1688a60a53/ml_dtypes-0.5.4-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce756d3a10d0c4067172804c9cc276ba9cc0ff47af9078ad439b075d1abdc29b", size = 5036993, upload-time = "2025-11-17T22:31:58.497Z" }, + { url = "https://files.pythonhosted.org/packages/eb/33/40cd74219417e78b97c47802037cf2d87b91973e18bb968a7da48a96ea44/ml_dtypes-0.5.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:533ce891ba774eabf607172254f2e7260ba5f57bdd64030c9a4fcfbd99815d0d", size = 5010956, upload-time = "2025-11-17T22:31:59.931Z" }, + { url = "https://files.pythonhosted.org/packages/e1/8b/200088c6859d8221454825959df35b5244fa9bdf263fd0249ac5fb75e281/ml_dtypes-0.5.4-cp313-cp313-win_amd64.whl", hash = "sha256:f21c9219ef48ca5ee78402d5cc831bd58ea27ce89beda894428bc67a52da5328", size = 212224, upload-time = "2025-11-17T22:32:01.349Z" }, + { url = "https://files.pythonhosted.org/packages/8f/75/dfc3775cb36367816e678f69a7843f6f03bd4e2bcd79941e01ea960a068e/ml_dtypes-0.5.4-cp313-cp313-win_arm64.whl", hash = "sha256:35f29491a3e478407f7047b8a4834e4640a77d2737e0b294d049746507af5175", size = 160798, upload-time = "2025-11-17T22:32:02.864Z" }, + { url = "https://files.pythonhosted.org/packages/4f/74/e9ddb35fd1dd43b1106c20ced3f53c2e8e7fc7598c15638e9f80677f81d4/ml_dtypes-0.5.4-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:304ad47faa395415b9ccbcc06a0350800bc50eda70f0e45326796e27c62f18b6", size = 702083, upload-time = "2025-11-17T22:32:04.08Z" }, + { url = "https://files.pythonhosted.org/packages/74/f5/667060b0aed1aa63166b22897fdf16dca9eb704e6b4bbf86848d5a181aa7/ml_dtypes-0.5.4-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6a0df4223b514d799b8a1629c65ddc351b3efa833ccf7f8ea0cf654a61d1e35d", size = 5354111, upload-time = "2025-11-17T22:32:05.546Z" }, + { url = "https://files.pythonhosted.org/packages/40/49/0f8c498a28c0efa5f5c95a9e374c83ec1385ca41d0e85e7cf40e5d519a21/ml_dtypes-0.5.4-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:531eff30e4d368cb6255bc2328d070e35836aa4f282a0fb5f3a0cd7260257298", size = 5366453, upload-time = "2025-11-17T22:32:07.115Z" }, + { url = "https://files.pythonhosted.org/packages/8c/27/12607423d0a9c6bbbcc780ad19f1f6baa2b68b18ce4bddcdc122c4c68dc9/ml_dtypes-0.5.4-cp313-cp313t-win_amd64.whl", hash = "sha256:cb73dccfc991691c444acc8c0012bee8f2470da826a92e3a20bb333b1a7894e6", size = 225612, upload-time = "2025-11-17T22:32:08.615Z" }, + { url = "https://files.pythonhosted.org/packages/e5/80/5a5929e92c72936d5b19872c5fb8fc09327c1da67b3b68c6a13139e77e20/ml_dtypes-0.5.4-cp313-cp313t-win_arm64.whl", hash = "sha256:3bbbe120b915090d9dd1375e4684dd17a20a2491ef25d640a908281da85e73f1", size = 164145, upload-time = "2025-11-17T22:32:09.782Z" }, + { url = "https://files.pythonhosted.org/packages/72/4e/1339dc6e2557a344f5ba5590872e80346f76f6cb2ac3dd16e4666e88818c/ml_dtypes-0.5.4-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:2b857d3af6ac0d39db1de7c706e69c7f9791627209c3d6dedbfca8c7e5faec22", size = 673781, upload-time = "2025-11-17T22:32:11.364Z" }, + { url = "https://files.pythonhosted.org/packages/04/f9/067b84365c7e83bda15bba2b06c6ca250ce27b20630b1128c435fb7a09aa/ml_dtypes-0.5.4-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:805cef3a38f4eafae3a5bf9ebdcdb741d0bcfd9e1bd90eb54abd24f928cd2465", size = 5036145, upload-time = "2025-11-17T22:32:12.783Z" }, + { url = "https://files.pythonhosted.org/packages/c6/bb/82c7dcf38070b46172a517e2334e665c5bf374a262f99a283ea454bece7c/ml_dtypes-0.5.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:14a4fd3228af936461db66faccef6e4f41c1d82fcc30e9f8d58a08916b1d811f", size = 5010230, upload-time = "2025-11-17T22:32:14.38Z" }, + { url = "https://files.pythonhosted.org/packages/e9/93/2bfed22d2498c468f6bcd0d9f56b033eaa19f33320389314c19ef6766413/ml_dtypes-0.5.4-cp314-cp314-win_amd64.whl", hash = "sha256:8c6a2dcebd6f3903e05d51960a8058d6e131fe69f952a5397e5dbabc841b6d56", size = 221032, upload-time = "2025-11-17T22:32:15.763Z" }, + { url = "https://files.pythonhosted.org/packages/76/a3/9c912fe6ea747bb10fe2f8f54d027eb265db05dfb0c6335e3e063e74e6e8/ml_dtypes-0.5.4-cp314-cp314-win_arm64.whl", hash = "sha256:5a0f68ca8fd8d16583dfa7793973feb86f2fbb56ce3966daf9c9f748f52a2049", size = 163353, upload-time = "2025-11-17T22:32:16.932Z" }, + { url = "https://files.pythonhosted.org/packages/cd/02/48aa7d84cc30ab4ee37624a2fd98c56c02326785750cd212bc0826c2f15b/ml_dtypes-0.5.4-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:bfc534409c5d4b0bf945af29e5d0ab075eae9eecbb549ff8a29280db822f34f9", size = 702085, upload-time = "2025-11-17T22:32:18.175Z" }, + { url = "https://files.pythonhosted.org/packages/5a/e7/85cb99fe80a7a5513253ec7faa88a65306be071163485e9a626fce1b6e84/ml_dtypes-0.5.4-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2314892cdc3fcf05e373d76d72aaa15fda9fb98625effa73c1d646f331fcecb7", size = 5355358, upload-time = "2025-11-17T22:32:19.7Z" }, + { url = "https://files.pythonhosted.org/packages/79/2b/a826ba18d2179a56e144aef69e57fb2ab7c464ef0b2111940ee8a3a223a2/ml_dtypes-0.5.4-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0d2ffd05a2575b1519dc928c0b93c06339eb67173ff53acb00724502cda231cf", size = 5366332, upload-time = "2025-11-17T22:32:21.193Z" }, + { url = "https://files.pythonhosted.org/packages/84/44/f4d18446eacb20ea11e82f133ea8f86e2bf2891785b67d9da8d0ab0ef525/ml_dtypes-0.5.4-cp314-cp314t-win_amd64.whl", hash = "sha256:4381fe2f2452a2d7589689693d3162e876b3ddb0a832cde7a414f8e1adf7eab1", size = 236612, upload-time = "2025-11-17T22:32:22.579Z" }, + { url = "https://files.pythonhosted.org/packages/ad/3f/3d42e9a78fe5edf792a83c074b13b9b770092a4fbf3462872f4303135f09/ml_dtypes-0.5.4-cp314-cp314t-win_arm64.whl", hash = "sha256:11942cbf2cf92157db91e5022633c0d9474d4dfd813a909383bd23ce828a4b7d", size = 168825, upload-time = "2025-11-17T22:32:23.766Z" }, +] + +[[package]] +name = "mpmath" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" }, +] + +[[package]] +name = "mypy" +version = "1.19.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "librt", marker = "platform_python_implementation != 'PyPy'" }, + { name = "mypy-extensions" }, + { name = "pathspec" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f5/db/4efed9504bc01309ab9c2da7e352cc223569f05478012b5d9ece38fd44d2/mypy-1.19.1.tar.gz", hash = "sha256:19d88bb05303fe63f71dd2c6270daca27cb9401c4ca8255fe50d1d920e0eb9ba", size = 3582404, upload-time = "2025-12-15T05:03:48.42Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2f/63/e499890d8e39b1ff2df4c0c6ce5d371b6844ee22b8250687a99fd2f657a8/mypy-1.19.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5f05aa3d375b385734388e844bc01733bd33c644ab48e9684faa54e5389775ec", size = 13101333, upload-time = "2025-12-15T05:03:03.28Z" }, + { url = "https://files.pythonhosted.org/packages/72/4b/095626fc136fba96effc4fd4a82b41d688ab92124f8c4f7564bffe5cf1b0/mypy-1.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:022ea7279374af1a5d78dfcab853fe6a536eebfda4b59deab53cd21f6cd9f00b", size = 12164102, upload-time = "2025-12-15T05:02:33.611Z" }, + { url = "https://files.pythonhosted.org/packages/0c/5b/952928dd081bf88a83a5ccd49aaecfcd18fd0d2710c7ff07b8fb6f7032b9/mypy-1.19.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee4c11e460685c3e0c64a4c5de82ae143622410950d6be863303a1c4ba0e36d6", size = 12765799, upload-time = "2025-12-15T05:03:28.44Z" }, + { url = "https://files.pythonhosted.org/packages/2a/0d/93c2e4a287f74ef11a66fb6d49c7a9f05e47b0a4399040e6719b57f500d2/mypy-1.19.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de759aafbae8763283b2ee5869c7255391fbc4de3ff171f8f030b5ec48381b74", size = 13522149, upload-time = "2025-12-15T05:02:36.011Z" }, + { url = "https://files.pythonhosted.org/packages/7b/0e/33a294b56aaad2b338d203e3a1d8b453637ac36cb278b45005e0901cf148/mypy-1.19.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ab43590f9cd5108f41aacf9fca31841142c786827a74ab7cc8a2eacb634e09a1", size = 13810105, upload-time = "2025-12-15T05:02:40.327Z" }, + { url = "https://files.pythonhosted.org/packages/0e/fd/3e82603a0cb66b67c5e7abababce6bf1a929ddf67bf445e652684af5c5a0/mypy-1.19.1-cp310-cp310-win_amd64.whl", hash = "sha256:2899753e2f61e571b3971747e302d5f420c3fd09650e1951e99f823bc3089dac", size = 10057200, upload-time = "2025-12-15T05:02:51.012Z" }, + { url = "https://files.pythonhosted.org/packages/ef/47/6b3ebabd5474d9cdc170d1342fbf9dddc1b0ec13ec90bf9004ee6f391c31/mypy-1.19.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d8dfc6ab58ca7dda47d9237349157500468e404b17213d44fc1cb77bce532288", size = 13028539, upload-time = "2025-12-15T05:03:44.129Z" }, + { url = "https://files.pythonhosted.org/packages/5c/a6/ac7c7a88a3c9c54334f53a941b765e6ec6c4ebd65d3fe8cdcfbe0d0fd7db/mypy-1.19.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e3f276d8493c3c97930e354b2595a44a21348b320d859fb4a2b9f66da9ed27ab", size = 12083163, upload-time = "2025-12-15T05:03:37.679Z" }, + { url = "https://files.pythonhosted.org/packages/67/af/3afa9cf880aa4a2c803798ac24f1d11ef72a0c8079689fac5cfd815e2830/mypy-1.19.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2abb24cf3f17864770d18d673c85235ba52456b36a06b6afc1e07c1fdcd3d0e6", size = 12687629, upload-time = "2025-12-15T05:02:31.526Z" }, + { url = "https://files.pythonhosted.org/packages/2d/46/20f8a7114a56484ab268b0ab372461cb3a8f7deed31ea96b83a4e4cfcfca/mypy-1.19.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a009ffa5a621762d0c926a078c2d639104becab69e79538a494bcccb62cc0331", size = 13436933, upload-time = "2025-12-15T05:03:15.606Z" }, + { url = "https://files.pythonhosted.org/packages/5b/f8/33b291ea85050a21f15da910002460f1f445f8007adb29230f0adea279cb/mypy-1.19.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f7cee03c9a2e2ee26ec07479f38ea9c884e301d42c6d43a19d20fb014e3ba925", size = 13661754, upload-time = "2025-12-15T05:02:26.731Z" }, + { url = "https://files.pythonhosted.org/packages/fd/a3/47cbd4e85bec4335a9cd80cf67dbc02be21b5d4c9c23ad6b95d6c5196bac/mypy-1.19.1-cp311-cp311-win_amd64.whl", hash = "sha256:4b84a7a18f41e167f7995200a1d07a4a6810e89d29859df936f1c3923d263042", size = 10055772, upload-time = "2025-12-15T05:03:26.179Z" }, + { url = "https://files.pythonhosted.org/packages/06/8a/19bfae96f6615aa8a0604915512e0289b1fad33d5909bf7244f02935d33a/mypy-1.19.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a8174a03289288c1f6c46d55cef02379b478bfbc8e358e02047487cad44c6ca1", size = 13206053, upload-time = "2025-12-15T05:03:46.622Z" }, + { url = "https://files.pythonhosted.org/packages/a5/34/3e63879ab041602154ba2a9f99817bb0c85c4df19a23a1443c8986e4d565/mypy-1.19.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ffcebe56eb09ff0c0885e750036a095e23793ba6c2e894e7e63f6d89ad51f22e", size = 12219134, upload-time = "2025-12-15T05:03:24.367Z" }, + { url = "https://files.pythonhosted.org/packages/89/cc/2db6f0e95366b630364e09845672dbee0cbf0bbe753a204b29a944967cd9/mypy-1.19.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b64d987153888790bcdb03a6473d321820597ab8dd9243b27a92153c4fa50fd2", size = 12731616, upload-time = "2025-12-15T05:02:44.725Z" }, + { url = "https://files.pythonhosted.org/packages/00/be/dd56c1fd4807bc1eba1cf18b2a850d0de7bacb55e158755eb79f77c41f8e/mypy-1.19.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c35d298c2c4bba75feb2195655dfea8124d855dfd7343bf8b8c055421eaf0cf8", size = 13620847, upload-time = "2025-12-15T05:03:39.633Z" }, + { url = "https://files.pythonhosted.org/packages/6d/42/332951aae42b79329f743bf1da088cd75d8d4d9acc18fbcbd84f26c1af4e/mypy-1.19.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:34c81968774648ab5ac09c29a375fdede03ba253f8f8287847bd480782f73a6a", size = 13834976, upload-time = "2025-12-15T05:03:08.786Z" }, + { url = "https://files.pythonhosted.org/packages/6f/63/e7493e5f90e1e085c562bb06e2eb32cae27c5057b9653348d38b47daaecc/mypy-1.19.1-cp312-cp312-win_amd64.whl", hash = "sha256:b10e7c2cd7870ba4ad9b2d8a6102eb5ffc1f16ca35e3de6bfa390c1113029d13", size = 10118104, upload-time = "2025-12-15T05:03:10.834Z" }, + { url = "https://files.pythonhosted.org/packages/de/9f/a6abae693f7a0c697dbb435aac52e958dc8da44e92e08ba88d2e42326176/mypy-1.19.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e3157c7594ff2ef1634ee058aafc56a82db665c9438fd41b390f3bde1ab12250", size = 13201927, upload-time = "2025-12-15T05:02:29.138Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a4/45c35ccf6e1c65afc23a069f50e2c66f46bd3798cbe0d680c12d12935caa/mypy-1.19.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bdb12f69bcc02700c2b47e070238f42cb87f18c0bc1fc4cdb4fb2bc5fd7a3b8b", size = 12206730, upload-time = "2025-12-15T05:03:01.325Z" }, + { url = "https://files.pythonhosted.org/packages/05/bb/cdcf89678e26b187650512620eec8368fded4cfd99cfcb431e4cdfd19dec/mypy-1.19.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f859fb09d9583a985be9a493d5cfc5515b56b08f7447759a0c5deaf68d80506e", size = 12724581, upload-time = "2025-12-15T05:03:20.087Z" }, + { url = "https://files.pythonhosted.org/packages/d1/32/dd260d52babf67bad8e6770f8e1102021877ce0edea106e72df5626bb0ec/mypy-1.19.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9a6538e0415310aad77cb94004ca6482330fece18036b5f360b62c45814c4ef", size = 13616252, upload-time = "2025-12-15T05:02:49.036Z" }, + { url = "https://files.pythonhosted.org/packages/71/d0/5e60a9d2e3bd48432ae2b454b7ef2b62a960ab51292b1eda2a95edd78198/mypy-1.19.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:da4869fc5e7f62a88f3fe0b5c919d1d9f7ea3cef92d3689de2823fd27e40aa75", size = 13840848, upload-time = "2025-12-15T05:02:55.95Z" }, + { url = "https://files.pythonhosted.org/packages/98/76/d32051fa65ecf6cc8c6610956473abdc9b4c43301107476ac03559507843/mypy-1.19.1-cp313-cp313-win_amd64.whl", hash = "sha256:016f2246209095e8eda7538944daa1d60e1e8134d98983b9fc1e92c1fc0cb8dd", size = 10135510, upload-time = "2025-12-15T05:02:58.438Z" }, + { url = "https://files.pythonhosted.org/packages/de/eb/b83e75f4c820c4247a58580ef86fcd35165028f191e7e1ba57128c52782d/mypy-1.19.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:06e6170bd5836770e8104c8fdd58e5e725cfeb309f0a6c681a811f557e97eac1", size = 13199744, upload-time = "2025-12-15T05:03:30.823Z" }, + { url = "https://files.pythonhosted.org/packages/94/28/52785ab7bfa165f87fcbb61547a93f98bb20e7f82f90f165a1f69bce7b3d/mypy-1.19.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:804bd67b8054a85447c8954215a906d6eff9cabeabe493fb6334b24f4bfff718", size = 12215815, upload-time = "2025-12-15T05:02:42.323Z" }, + { url = "https://files.pythonhosted.org/packages/0a/c6/bdd60774a0dbfb05122e3e925f2e9e846c009e479dcec4821dad881f5b52/mypy-1.19.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:21761006a7f497cb0d4de3d8ef4ca70532256688b0523eee02baf9eec895e27b", size = 12740047, upload-time = "2025-12-15T05:03:33.168Z" }, + { url = "https://files.pythonhosted.org/packages/32/2a/66ba933fe6c76bd40d1fe916a83f04fed253152f451a877520b3c4a5e41e/mypy-1.19.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:28902ee51f12e0f19e1e16fbe2f8f06b6637f482c459dd393efddd0ec7f82045", size = 13601998, upload-time = "2025-12-15T05:03:13.056Z" }, + { url = "https://files.pythonhosted.org/packages/e3/da/5055c63e377c5c2418760411fd6a63ee2b96cf95397259038756c042574f/mypy-1.19.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:481daf36a4c443332e2ae9c137dfee878fcea781a2e3f895d54bd3002a900957", size = 13807476, upload-time = "2025-12-15T05:03:17.977Z" }, + { url = "https://files.pythonhosted.org/packages/cd/09/4ebd873390a063176f06b0dbf1f7783dd87bd120eae7727fa4ae4179b685/mypy-1.19.1-cp314-cp314-win_amd64.whl", hash = "sha256:8bb5c6f6d043655e055be9b542aa5f3bdd30e4f3589163e85f93f3640060509f", size = 10281872, upload-time = "2025-12-15T05:03:05.549Z" }, + { url = "https://files.pythonhosted.org/packages/8d/f4/4ce9a05ce5ded1de3ec1c1d96cf9f9504a04e54ce0ed55cfa38619a32b8d/mypy-1.19.1-py3-none-any.whl", hash = "sha256:f1235f5ea01b7db5468d53ece6aaddf1ad0b88d9e7462b86ef96fe04995d7247", size = 2471239, upload-time = "2025-12-15T05:03:07.248Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, +] + +[[package]] +name = "networkx" +version = "3.4.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/fd/1d/06475e1cd5264c0b870ea2cc6fdb3e37177c1e565c43f56ff17a10e3937f/networkx-3.4.2.tar.gz", hash = "sha256:307c3669428c5362aab27c8a1260aa8f47c4e91d3891f48be0141738d8d053e1", size = 2151368, upload-time = "2024-10-21T12:39:38.695Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b9/54/dd730b32ea14ea797530a4479b2ed46a6fb250f682a9cfb997e968bf0261/networkx-3.4.2-py3-none-any.whl", hash = "sha256:df5d4365b724cf81b8c6a7312509d0c22386097011ad1abe274afd5e9d3bbc5f", size = 1723263, upload-time = "2024-10-21T12:39:36.247Z" }, +] + +[[package]] +name = "networkx" +version = "3.6.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.13'", + "python_full_version == '3.12.*'", + "python_full_version == '3.11.*'", +] +sdist = { url = "https://files.pythonhosted.org/packages/6a/51/63fe664f3908c97be9d2e4f1158eb633317598cfa6e1fc14af5383f17512/networkx-3.6.1.tar.gz", hash = "sha256:26b7c357accc0c8cde558ad486283728b65b6a95d85ee1cd66bafab4c8168509", size = 2517025, upload-time = "2025-12-08T17:02:39.908Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/c9/b2622292ea83fbb4ec318f5b9ab867d0a28ab43c5717bb85b0a5f6b3b0a4/networkx-3.6.1-py3-none-any.whl", hash = "sha256:d47fbf302e7d9cbbb9e2555a0d267983d2aa476bac30e90dfbe5669bd57f3762", size = 2068504, upload-time = "2025-12-08T17:02:38.159Z" }, +] + +[[package]] +name = "numpy" +version = "2.2.6" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/76/21/7d2a95e4bba9dc13d043ee156a356c0a8f0c6309dff6b21b4d71a073b8a8/numpy-2.2.6.tar.gz", hash = "sha256:e29554e2bef54a90aa5cc07da6ce955accb83f21ab5de01a62c8478897b264fd", size = 20276440, upload-time = "2025-05-17T22:38:04.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9a/3e/ed6db5be21ce87955c0cbd3009f2803f59fa08df21b5df06862e2d8e2bdd/numpy-2.2.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b412caa66f72040e6d268491a59f2c43bf03eb6c96dd8f0307829feb7fa2b6fb", size = 21165245, upload-time = "2025-05-17T21:27:58.555Z" }, + { url = "https://files.pythonhosted.org/packages/22/c2/4b9221495b2a132cc9d2eb862e21d42a009f5a60e45fc44b00118c174bff/numpy-2.2.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e41fd67c52b86603a91c1a505ebaef50b3314de0213461c7a6e99c9a3beff90", size = 14360048, upload-time = "2025-05-17T21:28:21.406Z" }, + { url = "https://files.pythonhosted.org/packages/fd/77/dc2fcfc66943c6410e2bf598062f5959372735ffda175b39906d54f02349/numpy-2.2.6-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:37e990a01ae6ec7fe7fa1c26c55ecb672dd98b19c3d0e1d1f326fa13cb38d163", size = 5340542, upload-time = "2025-05-17T21:28:30.931Z" }, + { url = "https://files.pythonhosted.org/packages/7a/4f/1cb5fdc353a5f5cc7feb692db9b8ec2c3d6405453f982435efc52561df58/numpy-2.2.6-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:5a6429d4be8ca66d889b7cf70f536a397dc45ba6faeb5f8c5427935d9592e9cf", size = 6878301, upload-time = "2025-05-17T21:28:41.613Z" }, + { url = "https://files.pythonhosted.org/packages/eb/17/96a3acd228cec142fcb8723bd3cc39c2a474f7dcf0a5d16731980bcafa95/numpy-2.2.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:efd28d4e9cd7d7a8d39074a4d44c63eda73401580c5c76acda2ce969e0a38e83", size = 14297320, upload-time = "2025-05-17T21:29:02.78Z" }, + { url = "https://files.pythonhosted.org/packages/b4/63/3de6a34ad7ad6646ac7d2f55ebc6ad439dbbf9c4370017c50cf403fb19b5/numpy-2.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc7b73d02efb0e18c000e9ad8b83480dfcd5dfd11065997ed4c6747470ae8915", size = 16801050, upload-time = "2025-05-17T21:29:27.675Z" }, + { url = "https://files.pythonhosted.org/packages/07/b6/89d837eddef52b3d0cec5c6ba0456c1bf1b9ef6a6672fc2b7873c3ec4e2e/numpy-2.2.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:74d4531beb257d2c3f4b261bfb0fc09e0f9ebb8842d82a7b4209415896adc680", size = 15807034, upload-time = "2025-05-17T21:29:51.102Z" }, + { url = "https://files.pythonhosted.org/packages/01/c8/dc6ae86e3c61cfec1f178e5c9f7858584049b6093f843bca541f94120920/numpy-2.2.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8fc377d995680230e83241d8a96def29f204b5782f371c532579b4f20607a289", size = 18614185, upload-time = "2025-05-17T21:30:18.703Z" }, + { url = "https://files.pythonhosted.org/packages/5b/c5/0064b1b7e7c89137b471ccec1fd2282fceaae0ab3a9550f2568782d80357/numpy-2.2.6-cp310-cp310-win32.whl", hash = "sha256:b093dd74e50a8cba3e873868d9e93a85b78e0daf2e98c6797566ad8044e8363d", size = 6527149, upload-time = "2025-05-17T21:30:29.788Z" }, + { url = "https://files.pythonhosted.org/packages/a3/dd/4b822569d6b96c39d1215dbae0582fd99954dcbcf0c1a13c61783feaca3f/numpy-2.2.6-cp310-cp310-win_amd64.whl", hash = "sha256:f0fd6321b839904e15c46e0d257fdd101dd7f530fe03fd6359c1ea63738703f3", size = 12904620, upload-time = "2025-05-17T21:30:48.994Z" }, + { url = "https://files.pythonhosted.org/packages/da/a8/4f83e2aa666a9fbf56d6118faaaf5f1974d456b1823fda0a176eff722839/numpy-2.2.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f9f1adb22318e121c5c69a09142811a201ef17ab257a1e66ca3025065b7f53ae", size = 21176963, upload-time = "2025-05-17T21:31:19.36Z" }, + { url = "https://files.pythonhosted.org/packages/b3/2b/64e1affc7972decb74c9e29e5649fac940514910960ba25cd9af4488b66c/numpy-2.2.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c820a93b0255bc360f53eca31a0e676fd1101f673dda8da93454a12e23fc5f7a", size = 14406743, upload-time = "2025-05-17T21:31:41.087Z" }, + { url = "https://files.pythonhosted.org/packages/4a/9f/0121e375000b5e50ffdd8b25bf78d8e1a5aa4cca3f185d41265198c7b834/numpy-2.2.6-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:3d70692235e759f260c3d837193090014aebdf026dfd167834bcba43e30c2a42", size = 5352616, upload-time = "2025-05-17T21:31:50.072Z" }, + { url = "https://files.pythonhosted.org/packages/31/0d/b48c405c91693635fbe2dcd7bc84a33a602add5f63286e024d3b6741411c/numpy-2.2.6-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:481b49095335f8eed42e39e8041327c05b0f6f4780488f61286ed3c01368d491", size = 6889579, upload-time = "2025-05-17T21:32:01.712Z" }, + { url = "https://files.pythonhosted.org/packages/52/b8/7f0554d49b565d0171eab6e99001846882000883998e7b7d9f0d98b1f934/numpy-2.2.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b64d8d4d17135e00c8e346e0a738deb17e754230d7e0810ac5012750bbd85a5a", size = 14312005, upload-time = "2025-05-17T21:32:23.332Z" }, + { url = "https://files.pythonhosted.org/packages/b3/dd/2238b898e51bd6d389b7389ffb20d7f4c10066d80351187ec8e303a5a475/numpy-2.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba10f8411898fc418a521833e014a77d3ca01c15b0c6cdcce6a0d2897e6dbbdf", size = 16821570, upload-time = "2025-05-17T21:32:47.991Z" }, + { url = "https://files.pythonhosted.org/packages/83/6c/44d0325722cf644f191042bf47eedad61c1e6df2432ed65cbe28509d404e/numpy-2.2.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:bd48227a919f1bafbdda0583705e547892342c26fb127219d60a5c36882609d1", size = 15818548, upload-time = "2025-05-17T21:33:11.728Z" }, + { url = "https://files.pythonhosted.org/packages/ae/9d/81e8216030ce66be25279098789b665d49ff19eef08bfa8cb96d4957f422/numpy-2.2.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9551a499bf125c1d4f9e250377c1ee2eddd02e01eac6644c080162c0c51778ab", size = 18620521, upload-time = "2025-05-17T21:33:39.139Z" }, + { url = "https://files.pythonhosted.org/packages/6a/fd/e19617b9530b031db51b0926eed5345ce8ddc669bb3bc0044b23e275ebe8/numpy-2.2.6-cp311-cp311-win32.whl", hash = "sha256:0678000bb9ac1475cd454c6b8c799206af8107e310843532b04d49649c717a47", size = 6525866, upload-time = "2025-05-17T21:33:50.273Z" }, + { url = "https://files.pythonhosted.org/packages/31/0a/f354fb7176b81747d870f7991dc763e157a934c717b67b58456bc63da3df/numpy-2.2.6-cp311-cp311-win_amd64.whl", hash = "sha256:e8213002e427c69c45a52bbd94163084025f533a55a59d6f9c5b820774ef3303", size = 12907455, upload-time = "2025-05-17T21:34:09.135Z" }, + { url = "https://files.pythonhosted.org/packages/82/5d/c00588b6cf18e1da539b45d3598d3557084990dcc4331960c15ee776ee41/numpy-2.2.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:41c5a21f4a04fa86436124d388f6ed60a9343a6f767fced1a8a71c3fbca038ff", size = 20875348, upload-time = "2025-05-17T21:34:39.648Z" }, + { url = "https://files.pythonhosted.org/packages/66/ee/560deadcdde6c2f90200450d5938f63a34b37e27ebff162810f716f6a230/numpy-2.2.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de749064336d37e340f640b05f24e9e3dd678c57318c7289d222a8a2f543e90c", size = 14119362, upload-time = "2025-05-17T21:35:01.241Z" }, + { url = "https://files.pythonhosted.org/packages/3c/65/4baa99f1c53b30adf0acd9a5519078871ddde8d2339dc5a7fde80d9d87da/numpy-2.2.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:894b3a42502226a1cac872f840030665f33326fc3dac8e57c607905773cdcde3", size = 5084103, upload-time = "2025-05-17T21:35:10.622Z" }, + { url = "https://files.pythonhosted.org/packages/cc/89/e5a34c071a0570cc40c9a54eb472d113eea6d002e9ae12bb3a8407fb912e/numpy-2.2.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:71594f7c51a18e728451bb50cc60a3ce4e6538822731b2933209a1f3614e9282", size = 6625382, upload-time = "2025-05-17T21:35:21.414Z" }, + { url = "https://files.pythonhosted.org/packages/f8/35/8c80729f1ff76b3921d5c9487c7ac3de9b2a103b1cd05e905b3090513510/numpy-2.2.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2618db89be1b4e05f7a1a847a9c1c0abd63e63a1607d892dd54668dd92faf87", size = 14018462, upload-time = "2025-05-17T21:35:42.174Z" }, + { url = "https://files.pythonhosted.org/packages/8c/3d/1e1db36cfd41f895d266b103df00ca5b3cbe965184df824dec5c08c6b803/numpy-2.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd83c01228a688733f1ded5201c678f0c53ecc1006ffbc404db9f7a899ac6249", size = 16527618, upload-time = "2025-05-17T21:36:06.711Z" }, + { url = "https://files.pythonhosted.org/packages/61/c6/03ed30992602c85aa3cd95b9070a514f8b3c33e31124694438d88809ae36/numpy-2.2.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:37c0ca431f82cd5fa716eca9506aefcabc247fb27ba69c5062a6d3ade8cf8f49", size = 15505511, upload-time = "2025-05-17T21:36:29.965Z" }, + { url = "https://files.pythonhosted.org/packages/b7/25/5761d832a81df431e260719ec45de696414266613c9ee268394dd5ad8236/numpy-2.2.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fe27749d33bb772c80dcd84ae7e8df2adc920ae8297400dabec45f0dedb3f6de", size = 18313783, upload-time = "2025-05-17T21:36:56.883Z" }, + { url = "https://files.pythonhosted.org/packages/57/0a/72d5a3527c5ebffcd47bde9162c39fae1f90138c961e5296491ce778e682/numpy-2.2.6-cp312-cp312-win32.whl", hash = "sha256:4eeaae00d789f66c7a25ac5f34b71a7035bb474e679f410e5e1a94deb24cf2d4", size = 6246506, upload-time = "2025-05-17T21:37:07.368Z" }, + { url = "https://files.pythonhosted.org/packages/36/fa/8c9210162ca1b88529ab76b41ba02d433fd54fecaf6feb70ef9f124683f1/numpy-2.2.6-cp312-cp312-win_amd64.whl", hash = "sha256:c1f9540be57940698ed329904db803cf7a402f3fc200bfe599334c9bd84a40b2", size = 12614190, upload-time = "2025-05-17T21:37:26.213Z" }, + { url = "https://files.pythonhosted.org/packages/f9/5c/6657823f4f594f72b5471f1db1ab12e26e890bb2e41897522d134d2a3e81/numpy-2.2.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0811bb762109d9708cca4d0b13c4f67146e3c3b7cf8d34018c722adb2d957c84", size = 20867828, upload-time = "2025-05-17T21:37:56.699Z" }, + { url = "https://files.pythonhosted.org/packages/dc/9e/14520dc3dadf3c803473bd07e9b2bd1b69bc583cb2497b47000fed2fa92f/numpy-2.2.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:287cc3162b6f01463ccd86be154f284d0893d2b3ed7292439ea97eafa8170e0b", size = 14143006, upload-time = "2025-05-17T21:38:18.291Z" }, + { url = "https://files.pythonhosted.org/packages/4f/06/7e96c57d90bebdce9918412087fc22ca9851cceaf5567a45c1f404480e9e/numpy-2.2.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:f1372f041402e37e5e633e586f62aa53de2eac8d98cbfb822806ce4bbefcb74d", size = 5076765, upload-time = "2025-05-17T21:38:27.319Z" }, + { url = "https://files.pythonhosted.org/packages/73/ed/63d920c23b4289fdac96ddbdd6132e9427790977d5457cd132f18e76eae0/numpy-2.2.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:55a4d33fa519660d69614a9fad433be87e5252f4b03850642f88993f7b2ca566", size = 6617736, upload-time = "2025-05-17T21:38:38.141Z" }, + { url = "https://files.pythonhosted.org/packages/85/c5/e19c8f99d83fd377ec8c7e0cf627a8049746da54afc24ef0a0cb73d5dfb5/numpy-2.2.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f92729c95468a2f4f15e9bb94c432a9229d0d50de67304399627a943201baa2f", size = 14010719, upload-time = "2025-05-17T21:38:58.433Z" }, + { url = "https://files.pythonhosted.org/packages/19/49/4df9123aafa7b539317bf6d342cb6d227e49f7a35b99c287a6109b13dd93/numpy-2.2.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bc23a79bfabc5d056d106f9befb8d50c31ced2fbc70eedb8155aec74a45798f", size = 16526072, upload-time = "2025-05-17T21:39:22.638Z" }, + { url = "https://files.pythonhosted.org/packages/b2/6c/04b5f47f4f32f7c2b0e7260442a8cbcf8168b0e1a41ff1495da42f42a14f/numpy-2.2.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e3143e4451880bed956e706a3220b4e5cf6172ef05fcc397f6f36a550b1dd868", size = 15503213, upload-time = "2025-05-17T21:39:45.865Z" }, + { url = "https://files.pythonhosted.org/packages/17/0a/5cd92e352c1307640d5b6fec1b2ffb06cd0dabe7d7b8227f97933d378422/numpy-2.2.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4f13750ce79751586ae2eb824ba7e1e8dba64784086c98cdbbcc6a42112ce0d", size = 18316632, upload-time = "2025-05-17T21:40:13.331Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3b/5cba2b1d88760ef86596ad0f3d484b1cbff7c115ae2429678465057c5155/numpy-2.2.6-cp313-cp313-win32.whl", hash = "sha256:5beb72339d9d4fa36522fc63802f469b13cdbe4fdab4a288f0c441b74272ebfd", size = 6244532, upload-time = "2025-05-17T21:43:46.099Z" }, + { url = "https://files.pythonhosted.org/packages/cb/3b/d58c12eafcb298d4e6d0d40216866ab15f59e55d148a5658bb3132311fcf/numpy-2.2.6-cp313-cp313-win_amd64.whl", hash = "sha256:b0544343a702fa80c95ad5d3d608ea3599dd54d4632df855e4c8d24eb6ecfa1c", size = 12610885, upload-time = "2025-05-17T21:44:05.145Z" }, + { url = "https://files.pythonhosted.org/packages/6b/9e/4bf918b818e516322db999ac25d00c75788ddfd2d2ade4fa66f1f38097e1/numpy-2.2.6-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0bca768cd85ae743b2affdc762d617eddf3bcf8724435498a1e80132d04879e6", size = 20963467, upload-time = "2025-05-17T21:40:44Z" }, + { url = "https://files.pythonhosted.org/packages/61/66/d2de6b291507517ff2e438e13ff7b1e2cdbdb7cb40b3ed475377aece69f9/numpy-2.2.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:fc0c5673685c508a142ca65209b4e79ed6740a4ed6b2267dbba90f34b0b3cfda", size = 14225144, upload-time = "2025-05-17T21:41:05.695Z" }, + { url = "https://files.pythonhosted.org/packages/e4/25/480387655407ead912e28ba3a820bc69af9adf13bcbe40b299d454ec011f/numpy-2.2.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5bd4fc3ac8926b3819797a7c0e2631eb889b4118a9898c84f585a54d475b7e40", size = 5200217, upload-time = "2025-05-17T21:41:15.903Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4a/6e313b5108f53dcbf3aca0c0f3e9c92f4c10ce57a0a721851f9785872895/numpy-2.2.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:fee4236c876c4e8369388054d02d0e9bb84821feb1a64dd59e137e6511a551f8", size = 6712014, upload-time = "2025-05-17T21:41:27.321Z" }, + { url = "https://files.pythonhosted.org/packages/b7/30/172c2d5c4be71fdf476e9de553443cf8e25feddbe185e0bd88b096915bcc/numpy-2.2.6-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e1dda9c7e08dc141e0247a5b8f49cf05984955246a327d4c48bda16821947b2f", size = 14077935, upload-time = "2025-05-17T21:41:49.738Z" }, + { url = "https://files.pythonhosted.org/packages/12/fb/9e743f8d4e4d3c710902cf87af3512082ae3d43b945d5d16563f26ec251d/numpy-2.2.6-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f447e6acb680fd307f40d3da4852208af94afdfab89cf850986c3ca00562f4fa", size = 16600122, upload-time = "2025-05-17T21:42:14.046Z" }, + { url = "https://files.pythonhosted.org/packages/12/75/ee20da0e58d3a66f204f38916757e01e33a9737d0b22373b3eb5a27358f9/numpy-2.2.6-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:389d771b1623ec92636b0786bc4ae56abafad4a4c513d36a55dce14bd9ce8571", size = 15586143, upload-time = "2025-05-17T21:42:37.464Z" }, + { url = "https://files.pythonhosted.org/packages/76/95/bef5b37f29fc5e739947e9ce5179ad402875633308504a52d188302319c8/numpy-2.2.6-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8e9ace4a37db23421249ed236fdcdd457d671e25146786dfc96835cd951aa7c1", size = 18385260, upload-time = "2025-05-17T21:43:05.189Z" }, + { url = "https://files.pythonhosted.org/packages/09/04/f2f83279d287407cf36a7a8053a5abe7be3622a4363337338f2585e4afda/numpy-2.2.6-cp313-cp313t-win32.whl", hash = "sha256:038613e9fb8c72b0a41f025a7e4c3f0b7a1b5d768ece4796b674c8f3fe13efff", size = 6377225, upload-time = "2025-05-17T21:43:16.254Z" }, + { url = "https://files.pythonhosted.org/packages/67/0e/35082d13c09c02c011cf21570543d202ad929d961c02a147493cb0c2bdf5/numpy-2.2.6-cp313-cp313t-win_amd64.whl", hash = "sha256:6031dd6dfecc0cf9f668681a37648373bddd6421fff6c66ec1624eed0180ee06", size = 12771374, upload-time = "2025-05-17T21:43:35.479Z" }, + { url = "https://files.pythonhosted.org/packages/9e/3b/d94a75f4dbf1ef5d321523ecac21ef23a3cd2ac8b78ae2aac40873590229/numpy-2.2.6-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0b605b275d7bd0c640cad4e5d30fa701a8d59302e127e5f79138ad62762c3e3d", size = 21040391, upload-time = "2025-05-17T21:44:35.948Z" }, + { url = "https://files.pythonhosted.org/packages/17/f4/09b2fa1b58f0fb4f7c7963a1649c64c4d315752240377ed74d9cd878f7b5/numpy-2.2.6-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:7befc596a7dc9da8a337f79802ee8adb30a552a94f792b9c9d18c840055907db", size = 6786754, upload-time = "2025-05-17T21:44:47.446Z" }, + { url = "https://files.pythonhosted.org/packages/af/30/feba75f143bdc868a1cc3f44ccfa6c4b9ec522b36458e738cd00f67b573f/numpy-2.2.6-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce47521a4754c8f4593837384bd3424880629f718d87c5d44f8ed763edd63543", size = 16643476, upload-time = "2025-05-17T21:45:11.871Z" }, + { url = "https://files.pythonhosted.org/packages/37/48/ac2a9584402fb6c0cd5b5d1a91dcf176b15760130dd386bbafdbfe3640bf/numpy-2.2.6-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d042d24c90c41b54fd506da306759e06e568864df8ec17ccc17e9e884634fd00", size = 12812666, upload-time = "2025-05-17T21:45:31.426Z" }, +] + +[[package]] +name = "numpy" +version = "2.4.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.13'", + "python_full_version == '3.12.*'", + "python_full_version == '3.11.*'", +] +sdist = { url = "https://files.pythonhosted.org/packages/57/fd/0005efbd0af48e55eb3c7208af93f2862d4b1a56cd78e84309a2d959208d/numpy-2.4.2.tar.gz", hash = "sha256:659a6107e31a83c4e33f763942275fd278b21d095094044eb35569e86a21ddae", size = 20723651, upload-time = "2026-01-31T23:13:10.135Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d3/44/71852273146957899753e69986246d6a176061ea183407e95418c2aa4d9a/numpy-2.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7e88598032542bd49af7c4747541422884219056c268823ef6e5e89851c8825", size = 16955478, upload-time = "2026-01-31T23:10:25.623Z" }, + { url = "https://files.pythonhosted.org/packages/74/41/5d17d4058bd0cd96bcbd4d9ff0fb2e21f52702aab9a72e4a594efa18692f/numpy-2.4.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7edc794af8b36ca37ef5fcb5e0d128c7e0595c7b96a2318d1badb6fcd8ee86b1", size = 14965467, upload-time = "2026-01-31T23:10:28.186Z" }, + { url = "https://files.pythonhosted.org/packages/49/48/fb1ce8136c19452ed15f033f8aee91d5defe515094e330ce368a0647846f/numpy-2.4.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:6e9f61981ace1360e42737e2bae58b27bf28a1b27e781721047d84bd754d32e7", size = 5475172, upload-time = "2026-01-31T23:10:30.848Z" }, + { url = "https://files.pythonhosted.org/packages/40/a9/3feb49f17bbd1300dd2570432961f5c8a4ffeff1db6f02c7273bd020a4c9/numpy-2.4.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:cb7bbb88aa74908950d979eeaa24dbdf1a865e3c7e45ff0121d8f70387b55f73", size = 6805145, upload-time = "2026-01-31T23:10:32.352Z" }, + { url = "https://files.pythonhosted.org/packages/3f/39/fdf35cbd6d6e2fcad42fcf85ac04a85a0d0fbfbf34b30721c98d602fd70a/numpy-2.4.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4f069069931240b3fc703f1e23df63443dbd6390614c8c44a87d96cd0ec81eb1", size = 15966084, upload-time = "2026-01-31T23:10:34.502Z" }, + { url = "https://files.pythonhosted.org/packages/1b/46/6fa4ea94f1ddf969b2ee941290cca6f1bfac92b53c76ae5f44afe17ceb69/numpy-2.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c02ef4401a506fb60b411467ad501e1429a3487abca4664871d9ae0b46c8ba32", size = 16899477, upload-time = "2026-01-31T23:10:37.075Z" }, + { url = "https://files.pythonhosted.org/packages/09/a1/2a424e162b1a14a5bd860a464ab4e07513916a64ab1683fae262f735ccd2/numpy-2.4.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2653de5c24910e49c2b106499803124dde62a5a1fe0eedeaecf4309a5f639390", size = 17323429, upload-time = "2026-01-31T23:10:39.704Z" }, + { url = "https://files.pythonhosted.org/packages/ce/a2/73014149ff250628df72c58204822ac01d768697913881aacf839ff78680/numpy-2.4.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1ae241bbfc6ae276f94a170b14785e561cb5e7f626b6688cf076af4110887413", size = 18635109, upload-time = "2026-01-31T23:10:41.924Z" }, + { url = "https://files.pythonhosted.org/packages/6c/0c/73e8be2f1accd56df74abc1c5e18527822067dced5ec0861b5bb882c2ce0/numpy-2.4.2-cp311-cp311-win32.whl", hash = "sha256:df1b10187212b198dd45fa943d8985a3c8cf854aed4923796e0e019e113a1bda", size = 6237915, upload-time = "2026-01-31T23:10:45.26Z" }, + { url = "https://files.pythonhosted.org/packages/76/ae/e0265e0163cf127c24c3969d29f1c4c64551a1e375d95a13d32eab25d364/numpy-2.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:b9c618d56a29c9cb1c4da979e9899be7578d2e0b3c24d52079c166324c9e8695", size = 12607972, upload-time = "2026-01-31T23:10:47.021Z" }, + { url = "https://files.pythonhosted.org/packages/29/a5/c43029af9b8014d6ea157f192652c50042e8911f4300f8f6ed3336bf437f/numpy-2.4.2-cp311-cp311-win_arm64.whl", hash = "sha256:47c5a6ed21d9452b10227e5e8a0e1c22979811cad7dcc19d8e3e2fb8fa03f1a3", size = 10485763, upload-time = "2026-01-31T23:10:50.087Z" }, + { url = "https://files.pythonhosted.org/packages/51/6e/6f394c9c77668153e14d4da83bcc247beb5952f6ead7699a1a2992613bea/numpy-2.4.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:21982668592194c609de53ba4933a7471880ccbaadcc52352694a59ecc860b3a", size = 16667963, upload-time = "2026-01-31T23:10:52.147Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f8/55483431f2b2fd015ae6ed4fe62288823ce908437ed49db5a03d15151678/numpy-2.4.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40397bda92382fcec844066efb11f13e1c9a3e2a8e8f318fb72ed8b6db9f60f1", size = 14693571, upload-time = "2026-01-31T23:10:54.789Z" }, + { url = "https://files.pythonhosted.org/packages/2f/20/18026832b1845cdc82248208dd929ca14c9d8f2bac391f67440707fff27c/numpy-2.4.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:b3a24467af63c67829bfaa61eecf18d5432d4f11992688537be59ecd6ad32f5e", size = 5203469, upload-time = "2026-01-31T23:10:57.343Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/2eb97c8a77daaba34eaa3fa7241a14ac5f51c46a6bd5911361b644c4a1e2/numpy-2.4.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:805cc8de9fd6e7a22da5aed858e0ab16be5a4db6c873dde1d7451c541553aa27", size = 6550820, upload-time = "2026-01-31T23:10:59.429Z" }, + { url = "https://files.pythonhosted.org/packages/b1/91/b97fdfd12dc75b02c44e26c6638241cc004d4079a0321a69c62f51470c4c/numpy-2.4.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6d82351358ffbcdcd7b686b90742a9b86632d6c1c051016484fa0b326a0a1548", size = 15663067, upload-time = "2026-01-31T23:11:01.291Z" }, + { url = "https://files.pythonhosted.org/packages/f5/c6/a18e59f3f0b8071cc85cbc8d80cd02d68aa9710170b2553a117203d46936/numpy-2.4.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e35d3e0144137d9fdae62912e869136164534d64a169f86438bc9561b6ad49f", size = 16619782, upload-time = "2026-01-31T23:11:03.669Z" }, + { url = "https://files.pythonhosted.org/packages/b7/83/9751502164601a79e18847309f5ceec0b1446d7b6aa12305759b72cf98b2/numpy-2.4.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:adb6ed2ad29b9e15321d167d152ee909ec73395901b70936f029c3bc6d7f4460", size = 17013128, upload-time = "2026-01-31T23:11:05.913Z" }, + { url = "https://files.pythonhosted.org/packages/61/c4/c4066322256ec740acc1c8923a10047818691d2f8aec254798f3dd90f5f2/numpy-2.4.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8906e71fd8afcb76580404e2a950caef2685df3d2a57fe82a86ac8d33cc007ba", size = 18345324, upload-time = "2026-01-31T23:11:08.248Z" }, + { url = "https://files.pythonhosted.org/packages/ab/af/6157aa6da728fa4525a755bfad486ae7e3f76d4c1864138003eb84328497/numpy-2.4.2-cp312-cp312-win32.whl", hash = "sha256:ec055f6dae239a6299cace477b479cca2fc125c5675482daf1dd886933a1076f", size = 5960282, upload-time = "2026-01-31T23:11:10.497Z" }, + { url = "https://files.pythonhosted.org/packages/92/0f/7ceaaeaacb40567071e94dbf2c9480c0ae453d5bb4f52bea3892c39dc83c/numpy-2.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:209fae046e62d0ce6435fcfe3b1a10537e858249b3d9b05829e2a05218296a85", size = 12314210, upload-time = "2026-01-31T23:11:12.176Z" }, + { url = "https://files.pythonhosted.org/packages/2f/a3/56c5c604fae6dd40fa2ed3040d005fca97e91bd320d232ac9931d77ba13c/numpy-2.4.2-cp312-cp312-win_arm64.whl", hash = "sha256:fbde1b0c6e81d56f5dccd95dd4a711d9b95df1ae4009a60887e56b27e8d903fa", size = 10220171, upload-time = "2026-01-31T23:11:14.684Z" }, + { url = "https://files.pythonhosted.org/packages/a1/22/815b9fe25d1d7ae7d492152adbc7226d3eff731dffc38fe970589fcaaa38/numpy-2.4.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:25f2059807faea4b077a2b6837391b5d830864b3543627f381821c646f31a63c", size = 16663696, upload-time = "2026-01-31T23:11:17.516Z" }, + { url = "https://files.pythonhosted.org/packages/09/f0/817d03a03f93ba9c6c8993de509277d84e69f9453601915e4a69554102a1/numpy-2.4.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bd3a7a9f5847d2fb8c2c6d1c862fa109c31a9abeca1a3c2bd5a64572955b2979", size = 14688322, upload-time = "2026-01-31T23:11:19.883Z" }, + { url = "https://files.pythonhosted.org/packages/da/b4/f805ab79293c728b9a99438775ce51885fd4f31b76178767cfc718701a39/numpy-2.4.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:8e4549f8a3c6d13d55041925e912bfd834285ef1dd64d6bc7d542583355e2e98", size = 5198157, upload-time = "2026-01-31T23:11:22.375Z" }, + { url = "https://files.pythonhosted.org/packages/74/09/826e4289844eccdcd64aac27d13b0fd3f32039915dd5b9ba01baae1f436c/numpy-2.4.2-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:aea4f66ff44dfddf8c2cffd66ba6538c5ec67d389285292fe428cb2c738c8aef", size = 6546330, upload-time = "2026-01-31T23:11:23.958Z" }, + { url = "https://files.pythonhosted.org/packages/19/fb/cbfdbfa3057a10aea5422c558ac57538e6acc87ec1669e666d32ac198da7/numpy-2.4.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c3cd545784805de05aafe1dde61752ea49a359ccba9760c1e5d1c88a93bbf2b7", size = 15660968, upload-time = "2026-01-31T23:11:25.713Z" }, + { url = "https://files.pythonhosted.org/packages/04/dc/46066ce18d01645541f0186877377b9371b8fa8017fa8262002b4ef22612/numpy-2.4.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d0d9b7c93578baafcbc5f0b83eaf17b79d345c6f36917ba0c67f45226911d499", size = 16607311, upload-time = "2026-01-31T23:11:28.117Z" }, + { url = "https://files.pythonhosted.org/packages/14/d9/4b5adfc39a43fa6bf918c6d544bc60c05236cc2f6339847fc5b35e6cb5b0/numpy-2.4.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f74f0f7779cc7ae07d1810aab8ac6b1464c3eafb9e283a40da7309d5e6e48fbb", size = 17012850, upload-time = "2026-01-31T23:11:30.888Z" }, + { url = "https://files.pythonhosted.org/packages/b7/20/adb6e6adde6d0130046e6fdfb7675cc62bc2f6b7b02239a09eb58435753d/numpy-2.4.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c7ac672d699bf36275c035e16b65539931347d68b70667d28984c9fb34e07fa7", size = 18334210, upload-time = "2026-01-31T23:11:33.214Z" }, + { url = "https://files.pythonhosted.org/packages/78/0e/0a73b3dff26803a8c02baa76398015ea2a5434d9b8265a7898a6028c1591/numpy-2.4.2-cp313-cp313-win32.whl", hash = "sha256:8e9afaeb0beff068b4d9cd20d322ba0ee1cecfb0b08db145e4ab4dd44a6b5110", size = 5958199, upload-time = "2026-01-31T23:11:35.385Z" }, + { url = "https://files.pythonhosted.org/packages/43/bc/6352f343522fcb2c04dbaf94cb30cca6fd32c1a750c06ad6231b4293708c/numpy-2.4.2-cp313-cp313-win_amd64.whl", hash = "sha256:7df2de1e4fba69a51c06c28f5a3de36731eb9639feb8e1cf7e4a7b0daf4cf622", size = 12310848, upload-time = "2026-01-31T23:11:38.001Z" }, + { url = "https://files.pythonhosted.org/packages/6e/8d/6da186483e308da5da1cc6918ce913dcfe14ffde98e710bfeff2a6158d4e/numpy-2.4.2-cp313-cp313-win_arm64.whl", hash = "sha256:0fece1d1f0a89c16b03442eae5c56dc0be0c7883b5d388e0c03f53019a4bfd71", size = 10221082, upload-time = "2026-01-31T23:11:40.392Z" }, + { url = "https://files.pythonhosted.org/packages/25/a1/9510aa43555b44781968935c7548a8926274f815de42ad3997e9e83680dd/numpy-2.4.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5633c0da313330fd20c484c78cdd3f9b175b55e1a766c4a174230c6b70ad8262", size = 14815866, upload-time = "2026-01-31T23:11:42.495Z" }, + { url = "https://files.pythonhosted.org/packages/36/30/6bbb5e76631a5ae46e7923dd16ca9d3f1c93cfa8d4ed79a129814a9d8db3/numpy-2.4.2-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:d9f64d786b3b1dd742c946c42d15b07497ed14af1a1f3ce840cce27daa0ce913", size = 5325631, upload-time = "2026-01-31T23:11:44.7Z" }, + { url = "https://files.pythonhosted.org/packages/46/00/3a490938800c1923b567b3a15cd17896e68052e2145d8662aaf3e1ffc58f/numpy-2.4.2-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:b21041e8cb6a1eb5312dd1d2f80a94d91efffb7a06b70597d44f1bd2dfc315ab", size = 6646254, upload-time = "2026-01-31T23:11:46.341Z" }, + { url = "https://files.pythonhosted.org/packages/d3/e9/fac0890149898a9b609caa5af7455a948b544746e4b8fe7c212c8edd71f8/numpy-2.4.2-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:00ab83c56211a1d7c07c25e3217ea6695e50a3e2f255053686b081dc0b091a82", size = 15720138, upload-time = "2026-01-31T23:11:48.082Z" }, + { url = "https://files.pythonhosted.org/packages/ea/5c/08887c54e68e1e28df53709f1893ce92932cc6f01f7c3d4dc952f61ffd4e/numpy-2.4.2-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2fb882da679409066b4603579619341c6d6898fc83a8995199d5249f986e8e8f", size = 16655398, upload-time = "2026-01-31T23:11:50.293Z" }, + { url = "https://files.pythonhosted.org/packages/4d/89/253db0fa0e66e9129c745e4ef25631dc37d5f1314dad2b53e907b8538e6d/numpy-2.4.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:66cb9422236317f9d44b67b4d18f44efe6e9c7f8794ac0462978513359461554", size = 17079064, upload-time = "2026-01-31T23:11:52.927Z" }, + { url = "https://files.pythonhosted.org/packages/2a/d5/cbade46ce97c59c6c3da525e8d95b7abe8a42974a1dc5c1d489c10433e88/numpy-2.4.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:0f01dcf33e73d80bd8dc0f20a71303abbafa26a19e23f6b68d1aa9990af90257", size = 18379680, upload-time = "2026-01-31T23:11:55.22Z" }, + { url = "https://files.pythonhosted.org/packages/40/62/48f99ae172a4b63d981babe683685030e8a3df4f246c893ea5c6ef99f018/numpy-2.4.2-cp313-cp313t-win32.whl", hash = "sha256:52b913ec40ff7ae845687b0b34d8d93b60cb66dcee06996dd5c99f2fc9328657", size = 6082433, upload-time = "2026-01-31T23:11:58.096Z" }, + { url = "https://files.pythonhosted.org/packages/07/38/e054a61cfe48ad9f1ed0d188e78b7e26859d0b60ef21cd9de4897cdb5326/numpy-2.4.2-cp313-cp313t-win_amd64.whl", hash = "sha256:5eea80d908b2c1f91486eb95b3fb6fab187e569ec9752ab7d9333d2e66bf2d6b", size = 12451181, upload-time = "2026-01-31T23:11:59.782Z" }, + { url = "https://files.pythonhosted.org/packages/6e/a4/a05c3a6418575e185dd84d0b9680b6bb2e2dc3e4202f036b7b4e22d6e9dc/numpy-2.4.2-cp313-cp313t-win_arm64.whl", hash = "sha256:fd49860271d52127d61197bb50b64f58454e9f578cb4b2c001a6de8b1f50b0b1", size = 10290756, upload-time = "2026-01-31T23:12:02.438Z" }, + { url = "https://files.pythonhosted.org/packages/18/88/b7df6050bf18fdcfb7046286c6535cabbdd2064a3440fca3f069d319c16e/numpy-2.4.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:444be170853f1f9d528428eceb55f12918e4fda5d8805480f36a002f1415e09b", size = 16663092, upload-time = "2026-01-31T23:12:04.521Z" }, + { url = "https://files.pythonhosted.org/packages/25/7a/1fee4329abc705a469a4afe6e69b1ef7e915117747886327104a8493a955/numpy-2.4.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:d1240d50adff70c2a88217698ca844723068533f3f5c5fa6ee2e3220e3bdb000", size = 14698770, upload-time = "2026-01-31T23:12:06.96Z" }, + { url = "https://files.pythonhosted.org/packages/fb/0b/f9e49ba6c923678ad5bc38181c08ac5e53b7a5754dbca8e581aa1a56b1ff/numpy-2.4.2-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:7cdde6de52fb6664b00b056341265441192d1291c130e99183ec0d4b110ff8b1", size = 5208562, upload-time = "2026-01-31T23:12:09.632Z" }, + { url = "https://files.pythonhosted.org/packages/7d/12/d7de8f6f53f9bb76997e5e4c069eda2051e3fe134e9181671c4391677bb2/numpy-2.4.2-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:cda077c2e5b780200b6b3e09d0b42205a3d1c68f30c6dceb90401c13bff8fe74", size = 6543710, upload-time = "2026-01-31T23:12:11.969Z" }, + { url = "https://files.pythonhosted.org/packages/09/63/c66418c2e0268a31a4cf8a8b512685748200f8e8e8ec6c507ce14e773529/numpy-2.4.2-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d30291931c915b2ab5717c2974bb95ee891a1cf22ebc16a8006bd59cd210d40a", size = 15677205, upload-time = "2026-01-31T23:12:14.33Z" }, + { url = "https://files.pythonhosted.org/packages/5d/6c/7f237821c9642fb2a04d2f1e88b4295677144ca93285fd76eff3bcba858d/numpy-2.4.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bba37bc29d4d85761deed3954a1bc62be7cf462b9510b51d367b769a8c8df325", size = 16611738, upload-time = "2026-01-31T23:12:16.525Z" }, + { url = "https://files.pythonhosted.org/packages/c2/a7/39c4cdda9f019b609b5c473899d87abff092fc908cfe4d1ecb2fcff453b0/numpy-2.4.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b2f0073ed0868db1dcd86e052d37279eef185b9c8db5bf61f30f46adac63c909", size = 17028888, upload-time = "2026-01-31T23:12:19.306Z" }, + { url = "https://files.pythonhosted.org/packages/da/b3/e84bb64bdfea967cc10950d71090ec2d84b49bc691df0025dddb7c26e8e3/numpy-2.4.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7f54844851cdb630ceb623dcec4db3240d1ac13d4990532446761baede94996a", size = 18339556, upload-time = "2026-01-31T23:12:21.816Z" }, + { url = "https://files.pythonhosted.org/packages/88/f5/954a291bc1192a27081706862ac62bb5920fbecfbaa302f64682aa90beed/numpy-2.4.2-cp314-cp314-win32.whl", hash = "sha256:12e26134a0331d8dbd9351620f037ec470b7c75929cb8a1537f6bfe411152a1a", size = 6006899, upload-time = "2026-01-31T23:12:24.14Z" }, + { url = "https://files.pythonhosted.org/packages/05/cb/eff72a91b2efdd1bc98b3b8759f6a1654aa87612fc86e3d87d6fe4f948c4/numpy-2.4.2-cp314-cp314-win_amd64.whl", hash = "sha256:068cdb2d0d644cdb45670810894f6a0600797a69c05f1ac478e8d31670b8ee75", size = 12443072, upload-time = "2026-01-31T23:12:26.33Z" }, + { url = "https://files.pythonhosted.org/packages/37/75/62726948db36a56428fce4ba80a115716dc4fad6a3a4352487f8bb950966/numpy-2.4.2-cp314-cp314-win_arm64.whl", hash = "sha256:6ed0be1ee58eef41231a5c943d7d1375f093142702d5723ca2eb07db9b934b05", size = 10494886, upload-time = "2026-01-31T23:12:28.488Z" }, + { url = "https://files.pythonhosted.org/packages/36/2f/ee93744f1e0661dc267e4b21940870cabfae187c092e1433b77b09b50ac4/numpy-2.4.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:98f16a80e917003a12c0580f97b5f875853ebc33e2eaa4bccfc8201ac6869308", size = 14818567, upload-time = "2026-01-31T23:12:30.709Z" }, + { url = "https://files.pythonhosted.org/packages/a7/24/6535212add7d76ff938d8bdc654f53f88d35cddedf807a599e180dcb8e66/numpy-2.4.2-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:20abd069b9cda45874498b245c8015b18ace6de8546bf50dfa8cea1696ed06ef", size = 5328372, upload-time = "2026-01-31T23:12:32.962Z" }, + { url = "https://files.pythonhosted.org/packages/5e/9d/c48f0a035725f925634bf6b8994253b43f2047f6778a54147d7e213bc5a7/numpy-2.4.2-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:e98c97502435b53741540a5717a6749ac2ada901056c7db951d33e11c885cc7d", size = 6649306, upload-time = "2026-01-31T23:12:34.797Z" }, + { url = "https://files.pythonhosted.org/packages/81/05/7c73a9574cd4a53a25907bad38b59ac83919c0ddc8234ec157f344d57d9a/numpy-2.4.2-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:da6cad4e82cb893db4b69105c604d805e0c3ce11501a55b5e9f9083b47d2ffe8", size = 15722394, upload-time = "2026-01-31T23:12:36.565Z" }, + { url = "https://files.pythonhosted.org/packages/35/fa/4de10089f21fc7d18442c4a767ab156b25c2a6eaf187c0db6d9ecdaeb43f/numpy-2.4.2-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e4424677ce4b47fe73c8b5556d876571f7c6945d264201180db2dc34f676ab5", size = 16653343, upload-time = "2026-01-31T23:12:39.188Z" }, + { url = "https://files.pythonhosted.org/packages/b8/f9/d33e4ffc857f3763a57aa85650f2e82486832d7492280ac21ba9efda80da/numpy-2.4.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2b8f157c8a6f20eb657e240f8985cc135598b2b46985c5bccbde7616dc9c6b1e", size = 17078045, upload-time = "2026-01-31T23:12:42.041Z" }, + { url = "https://files.pythonhosted.org/packages/c8/b8/54bdb43b6225badbea6389fa038c4ef868c44f5890f95dd530a218706da3/numpy-2.4.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5daf6f3914a733336dab21a05cdec343144600e964d2fcdabaac0c0269874b2a", size = 18380024, upload-time = "2026-01-31T23:12:44.331Z" }, + { url = "https://files.pythonhosted.org/packages/a5/55/6e1a61ded7af8df04016d81b5b02daa59f2ea9252ee0397cb9f631efe9e5/numpy-2.4.2-cp314-cp314t-win32.whl", hash = "sha256:8c50dd1fc8826f5b26a5ee4d77ca55d88a895f4e4819c7ecc2a9f5905047a443", size = 6153937, upload-time = "2026-01-31T23:12:47.229Z" }, + { url = "https://files.pythonhosted.org/packages/45/aa/fa6118d1ed6d776b0983f3ceac9b1a5558e80df9365b1c3aa6d42bf9eee4/numpy-2.4.2-cp314-cp314t-win_amd64.whl", hash = "sha256:fcf92bee92742edd401ba41135185866f7026c502617f422eb432cfeca4fe236", size = 12631844, upload-time = "2026-01-31T23:12:48.997Z" }, + { url = "https://files.pythonhosted.org/packages/32/0a/2ec5deea6dcd158f254a7b372fb09cfba5719419c8d66343bab35237b3fb/numpy-2.4.2-cp314-cp314t-win_arm64.whl", hash = "sha256:1f92f53998a17265194018d1cc321b2e96e900ca52d54c7c77837b71b9465181", size = 10565379, upload-time = "2026-01-31T23:12:51.345Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f8/50e14d36d915ef64d8f8bc4a087fc8264d82c785eda6711f80ab7e620335/numpy-2.4.2-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:89f7268c009bc492f506abd6f5265defa7cb3f7487dc21d357c3d290add45082", size = 16833179, upload-time = "2026-01-31T23:12:53.5Z" }, + { url = "https://files.pythonhosted.org/packages/17/17/809b5cad63812058a8189e91a1e2d55a5a18fd04611dbad244e8aeae465c/numpy-2.4.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:e6dee3bb76aa4009d5a912180bf5b2de012532998d094acee25d9cb8dee3e44a", size = 14889755, upload-time = "2026-01-31T23:12:55.933Z" }, + { url = "https://files.pythonhosted.org/packages/3e/ea/181b9bcf7627fc8371720316c24db888dcb9829b1c0270abf3d288b2e29b/numpy-2.4.2-pp311-pypy311_pp73-macosx_14_0_arm64.whl", hash = "sha256:cd2bd2bbed13e213d6b55dc1d035a4f91748a7d3edc9480c13898b0353708920", size = 5399500, upload-time = "2026-01-31T23:12:58.671Z" }, + { url = "https://files.pythonhosted.org/packages/33/9f/413adf3fc955541ff5536b78fcf0754680b3c6d95103230252a2c9408d23/numpy-2.4.2-pp311-pypy311_pp73-macosx_14_0_x86_64.whl", hash = "sha256:cf28c0c1d4c4bf00f509fa7eb02c58d7caf221b50b467bcb0d9bbf1584d5c821", size = 6714252, upload-time = "2026-01-31T23:13:00.518Z" }, + { url = "https://files.pythonhosted.org/packages/91/da/643aad274e29ccbdf42ecd94dafe524b81c87bcb56b83872d54827f10543/numpy-2.4.2-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e04ae107ac591763a47398bb45b568fc38f02dbc4aa44c063f67a131f99346cb", size = 15797142, upload-time = "2026-01-31T23:13:02.219Z" }, + { url = "https://files.pythonhosted.org/packages/66/27/965b8525e9cb5dc16481b30a1b3c21e50c7ebf6e9dbd48d0c4d0d5089c7e/numpy-2.4.2-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:602f65afdef699cda27ec0b9224ae5dc43e328f4c24c689deaf77133dbee74d0", size = 16727979, upload-time = "2026-01-31T23:13:04.62Z" }, + { url = "https://files.pythonhosted.org/packages/de/e5/b7d20451657664b07986c2f6e3be564433f5dcaf3482d68eaecd79afaf03/numpy-2.4.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:be71bf1edb48ebbbf7f6337b5bfd2f895d1902f6335a5830b20141fc126ffba0", size = 12502577, upload-time = "2026-01-31T23:13:07.08Z" }, +] + +[[package]] +name = "onnx" +version = "1.20.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ml-dtypes" }, + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "numpy", version = "2.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "protobuf" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3b/8a/335c03a8683a88a32f9a6bb98899ea6df241a41df64b37b9696772414794/onnx-1.20.1.tar.gz", hash = "sha256:ded16de1df563d51fbc1ad885f2a426f814039d8b5f4feb77febe09c0295ad67", size = 12048980, upload-time = "2026-01-10T01:40:03.043Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/cc/4ba3c80cfaffdb541dc5a23eaccb045a627361e94ecaeba30496270f15b3/onnx-1.20.1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:3fe243e83ad737637af6512708454e720d4b0864def2b28e6b0ee587b80a50be", size = 17904206, upload-time = "2026-01-10T01:38:58.574Z" }, + { url = "https://files.pythonhosted.org/packages/f3/fc/3a1c4ae2cd5cfab2d0ebc1842769b04b417fe13946144a7c8ce470dd9c85/onnx-1.20.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e24e96b48f27e4d6b44cb0b195b367a2665da2d819621eec51903d575fc49d38", size = 17414849, upload-time = "2026-01-10T01:39:01.494Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ab/5017945291b981f2681fb620f2d5b6070e02170c648770711ef1eac79d56/onnx-1.20.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0903e6088ed5e8f59ebd381ab2a6e9b2a60b4c898f79aa2fe76bb79cf38a5031", size = 17513600, upload-time = "2026-01-10T01:39:04.348Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b0/063e79dc365972af876d786bacc6acd8909691af2b9296615ff74ad182f3/onnx-1.20.1-cp310-cp310-win32.whl", hash = "sha256:17483e59082b2ca6cadd2b48fd8dce937e5b2c985ed5583fefc38af928be1826", size = 16239159, upload-time = "2026-01-10T01:39:07.254Z" }, + { url = "https://files.pythonhosted.org/packages/2a/73/a992271eb3683e676239d71b5a78ad3cf4d06d2223c387e701bf305da199/onnx-1.20.1-cp310-cp310-win_amd64.whl", hash = "sha256:e2b0cf797faedfd3b83491dc168ab5f1542511448c65ceb482f20f04420cbf3a", size = 16391718, upload-time = "2026-01-10T01:39:09.96Z" }, + { url = "https://files.pythonhosted.org/packages/0c/38/1a0e74d586c08833404100f5c052f92732fb5be417c0b2d7cb0838443bfe/onnx-1.20.1-cp311-cp311-macosx_12_0_universal2.whl", hash = "sha256:53426e1b458641e7a537e9f176330012ff59d90206cac1c1a9d03cdd73ed3095", size = 17904965, upload-time = "2026-01-10T01:39:13.532Z" }, + { url = "https://files.pythonhosted.org/packages/96/25/64b076e9684d17335f80b15b3bf502f7a8e1a89f08a6b208d4f2861b3011/onnx-1.20.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ca7281f8c576adf396c338cf43fff26faee8d4d2e2577b8e73738f37ceccf945", size = 17415179, upload-time = "2026-01-10T01:39:16.516Z" }, + { url = "https://files.pythonhosted.org/packages/ac/d5/6743b409421ced20ad5af1b3a7b4c4e568689ffaca86db431692fca409a6/onnx-1.20.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2297f428c51c7fc6d8fad0cf34384284dfeff3f86799f8e83ef905451348ade0", size = 17513672, upload-time = "2026-01-10T01:39:19.35Z" }, + { url = "https://files.pythonhosted.org/packages/9a/6b/dae82e6fdb2043302f29adca37522312ea2be55b75907b59be06fbdffe87/onnx-1.20.1-cp311-cp311-win32.whl", hash = "sha256:63d9cbcab8c96841eadeb7c930e07bfab4dde8081eb76fb68e0dfb222706b81e", size = 16239336, upload-time = "2026-01-10T01:39:22.506Z" }, + { url = "https://files.pythonhosted.org/packages/8e/17/a0d7863390c1f2067d7c02dcc1477034965c32aaa1407bfcf775305ffee4/onnx-1.20.1-cp311-cp311-win_amd64.whl", hash = "sha256:d78cde72d7ca8356a2d99c5dc0dbf67264254828cae2c5780184486c0cd7b3bf", size = 16392120, upload-time = "2026-01-10T01:39:25.106Z" }, + { url = "https://files.pythonhosted.org/packages/aa/72/9b879a46eb7a3322223791f36bf9c25d95da9ed93779eabb75a560f22e5b/onnx-1.20.1-cp311-cp311-win_arm64.whl", hash = "sha256:0104bb2d4394c179bcea3df7599a45a2932b80f4633840896fcf0d7d8daecea2", size = 16346923, upload-time = "2026-01-10T01:39:27.782Z" }, + { url = "https://files.pythonhosted.org/packages/7c/4c/4b17e82f91ab9aa07ff595771e935ca73547b035030dc5f5a76e63fbfea9/onnx-1.20.1-cp312-abi3-macosx_12_0_universal2.whl", hash = "sha256:1d923bb4f0ce1b24c6859222a7e6b2f123e7bfe7623683662805f2e7b9e95af2", size = 17903547, upload-time = "2026-01-10T01:39:31.015Z" }, + { url = "https://files.pythonhosted.org/packages/64/5e/1bfa100a9cb3f2d3d5f2f05f52f7e60323b0e20bb0abace1ae64dbc88f25/onnx-1.20.1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ddc0b7d8b5a94627dc86c533d5e415af94cbfd103019a582669dad1f56d30281", size = 17412021, upload-time = "2026-01-10T01:39:33.885Z" }, + { url = "https://files.pythonhosted.org/packages/fb/71/d3fec0dcf9a7a99e7368112d9c765154e81da70fcba1e3121131a45c245b/onnx-1.20.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9336b6b8e6efcf5c490a845f6afd7e041c89a56199aeda384ed7d58fb953b080", size = 17510450, upload-time = "2026-01-10T01:39:36.589Z" }, + { url = "https://files.pythonhosted.org/packages/74/a7/edce1403e05a46e59b502fae8e3350ceeac5841f8e8f1561e98562ed9b09/onnx-1.20.1-cp312-abi3-win32.whl", hash = "sha256:564c35a94811979808ab5800d9eb4f3f32c12daedba7e33ed0845f7c61ef2431", size = 16238216, upload-time = "2026-01-10T01:39:39.46Z" }, + { url = "https://files.pythonhosted.org/packages/8b/c7/8690c81200ae652ac550c1df52f89d7795e6cc941f3cb38c9ef821419e80/onnx-1.20.1-cp312-abi3-win_amd64.whl", hash = "sha256:9fe7f9a633979d50984b94bda8ceb7807403f59a341d09d19342dc544d0ca1d5", size = 16389207, upload-time = "2026-01-10T01:39:41.955Z" }, + { url = "https://files.pythonhosted.org/packages/01/a0/4fb0e6d36eaf079af366b2c1f68bafe92df6db963e2295da84388af64abc/onnx-1.20.1-cp312-abi3-win_arm64.whl", hash = "sha256:21d747348b1c8207406fa2f3e12b82f53e0d5bb3958bcd0288bd27d3cb6ebb00", size = 16344155, upload-time = "2026-01-10T01:39:45.536Z" }, + { url = "https://files.pythonhosted.org/packages/ea/bb/715fad292b255664f0e603f1b2ef7bf2b386281775f37406beb99fa05957/onnx-1.20.1-cp313-cp313t-macosx_12_0_universal2.whl", hash = "sha256:29197b768f5acdd1568ddeb0a376407a2817844f6ac1ef8c8dd2d974c9ab27c3", size = 17912296, upload-time = "2026-01-10T01:39:48.21Z" }, + { url = "https://files.pythonhosted.org/packages/2d/c3/541af12c3d45e159a94ee701100ba9e94b7bd8b7a8ac5ca6838569f894f8/onnx-1.20.1-cp313-cp313t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1f0371aa67f51917a09cc829ada0f9a79a58f833449e03d748f7f7f53787c43c", size = 17416925, upload-time = "2026-01-10T01:39:50.82Z" }, + { url = "https://files.pythonhosted.org/packages/2c/3b/d5660a7d2ddf14f531ca66d409239f543bb290277c3f14f4b4b78e32efa3/onnx-1.20.1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:be1e5522200b203b34327b2cf132ddec20ab063469476e1f5b02bb7bd259a489", size = 17515602, upload-time = "2026-01-10T01:39:54.132Z" }, + { url = "https://files.pythonhosted.org/packages/9c/b4/47225ab2a92562eff87ba9a1a028e3535d659a7157d7cde659003998b8e3/onnx-1.20.1-cp313-cp313t-win_amd64.whl", hash = "sha256:15c815313bbc4b2fdc7e4daeb6e26b6012012adc4d850f4e3b09ed327a7ea92a", size = 16395729, upload-time = "2026-01-10T01:39:57.577Z" }, + { url = "https://files.pythonhosted.org/packages/aa/7d/1bbe626ff6b192c844d3ad34356840cc60fca02e2dea0db95e01645758b1/onnx-1.20.1-cp313-cp313t-win_arm64.whl", hash = "sha256:eb335d7bcf9abac82a0d6a0fda0363531ae0b22cfd0fc6304bff32ee29905def", size = 16348968, upload-time = "2026-01-10T01:40:00.491Z" }, +] + +[[package]] +name = "onnxoptimizer" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "onnx" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5b/a7/e4f0e67a7e077d7cc65b968febfc53f8f52d3a22257624aa7977f14fff8c/onnxoptimizer-0.4.2.tar.gz", hash = "sha256:dac4a972b5dc80a870b930e85e4b043d090d4546d7878106ef8448e07f94622e", size = 12062394, upload-time = "2026-01-07T14:24:39.048Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/60/1e08c455e8262b7a8ecc2c10e586a7aaa517c0b9e3771b3c7b5ec80b6f29/onnxoptimizer-0.4.2-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:73b0859397ea1ffca6e896c6799c48933f09b16226def686264e68ef386f1239", size = 1219547, upload-time = "2026-01-07T14:24:24.753Z" }, + { url = "https://files.pythonhosted.org/packages/38/9c/09f01912085cd8f2c1a1bcd6d74106d85e839f0b06fc705b843086553a8e/onnxoptimizer-0.4.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ee2ed3cc6cc08543fc542c65d49bf2a8933e185b454d576ae3cd1bc877ee858c", size = 1019278, upload-time = "2026-01-07T14:24:26.405Z" }, + { url = "https://files.pythonhosted.org/packages/b0/28/15ed9afb400f964cd4f1ab0bb790623d2d2a6acf755221cc717c34492b3e/onnxoptimizer-0.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:65185aa0a3629db7d6618762dfb6ec1afa19401048773318191eef7b55eb142c", size = 488107, upload-time = "2026-01-07T14:24:28.12Z" }, + { url = "https://files.pythonhosted.org/packages/f8/f4/c0eae052169bb058c847f9ed3a4c217e2a3b2f63177e370b1ee2afd2e614/onnxoptimizer-0.4.2-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:b6aeaf03ecfa626b2e716ce910b1547d450d4b79673ab1c446fd761c05c8dcf8", size = 1219493, upload-time = "2026-01-07T14:24:29.825Z" }, + { url = "https://files.pythonhosted.org/packages/cc/7c/99b072778f66e0f95e43874f6a2fd2b96968979e1fb644d186abbed2f2e6/onnxoptimizer-0.4.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f278dc846b7144b7bdd063d0838848bdf45ce2e35d205379f169ec77deb76d9e", size = 1019369, upload-time = "2026-01-07T14:24:31.489Z" }, + { url = "https://files.pythonhosted.org/packages/e6/5a/43b60c74ea2f3024340452962b0fbbf2300907d4e88e31847f4e67faa631/onnxoptimizer-0.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:74f5400833dbdd9439d17c0fd78b962fd2ae7a369169e41e19dd09ae532350b6", size = 488155, upload-time = "2026-01-07T14:24:32.879Z" }, + { url = "https://files.pythonhosted.org/packages/e7/e9/bedd490a39b5201d33aea1f2812ca74bba9b30defa66fc94e3d46878b8b8/onnxoptimizer-0.4.2-cp312-abi3-macosx_10_15_universal2.whl", hash = "sha256:7229ffe7d54c692e4ba0a2516f94805a4f462e7fce7634e080a381fb82ec2378", size = 1217661, upload-time = "2026-01-07T14:24:34.475Z" }, + { url = "https://files.pythonhosted.org/packages/85/3e/d512bf70a66f85d3d7bfc79380da24c026d6409b28c5cd48f2d91e450046/onnxoptimizer-0.4.2-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:af19ee4dd7a852a18511aeabdbe1e3c8b4dd8e02b187356965b269d480ac7147", size = 1016175, upload-time = "2026-01-07T14:24:36.265Z" }, + { url = "https://files.pythonhosted.org/packages/67/c1/173031e8e5f9185a168209ead6f8b5e985f951a817d7b7b9c62a335a1a33/onnxoptimizer-0.4.2-cp312-abi3-win_amd64.whl", hash = "sha256:cc85d031f35689d36d91e79770611015014c41278fd39b664c6ccc27dc045aa0", size = 486848, upload-time = "2026-01-07T14:24:37.57Z" }, +] + +[[package]] +name = "onnxruntime" +version = "1.24.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "flatbuffers" }, + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "numpy", version = "2.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "packaging" }, + { name = "protobuf" }, + { name = "sympy" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/15/41/3253db975a90c3ce1d475e2a230773a21cd7998537f0657947df6fb79861/onnxruntime-1.24.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:3e6456801c66b095c5cd68e690ca25db970ea5202bd0c5b84a2c3ef7731c5a3c", size = 17332766, upload-time = "2026-03-05T17:18:59.714Z" }, + { url = "https://files.pythonhosted.org/packages/7e/c5/3af6b325f1492d691b23844d88ed26844c1164620860c5efe95c0e22782d/onnxruntime-1.24.3-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b2ebc54c6d8281dccff78d4b06e47d4cf07535937584ab759448390a70f4978", size = 15130330, upload-time = "2026-03-05T16:34:53.831Z" }, + { url = "https://files.pythonhosted.org/packages/03/4b/f96b46c1866a293ed23ca2cf5e5a63d413ad3a951da60dd877e3c56cbbca/onnxruntime-1.24.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fb56575d7794bf0781156955610c9e651c9504c64d42ec880784b6106244882d", size = 17213247, upload-time = "2026-03-05T17:17:59.812Z" }, + { url = "https://files.pythonhosted.org/packages/36/13/27cf4d8df2578747584e8758aeb0b673b60274048510257f1f084b15e80e/onnxruntime-1.24.3-cp311-cp311-win_amd64.whl", hash = "sha256:c958222ef9eff54018332beecd32d5d94a3ab079d8821937b333811bf4da0d39", size = 12595530, upload-time = "2026-03-05T17:18:49.356Z" }, + { url = "https://files.pythonhosted.org/packages/19/8c/6d9f31e6bae72a8079be12ed8ba36c4126a571fad38ded0a1b96f60f6896/onnxruntime-1.24.3-cp311-cp311-win_arm64.whl", hash = "sha256:a8f761857ebaf58a85b9e42422d03207f1d39e6bb8fecfdbf613bac5b9710723", size = 12261715, upload-time = "2026-03-05T17:18:39.699Z" }, + { url = "https://files.pythonhosted.org/packages/d0/7f/dfdc4e52600fde4c02d59bfe98c4b057931c1114b701e175aee311a9bc11/onnxruntime-1.24.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:0d244227dc5e00a9ae15a7ac1eba4c4460d7876dfecafe73fb00db9f1d914d91", size = 17342578, upload-time = "2026-03-05T17:19:02.403Z" }, + { url = "https://files.pythonhosted.org/packages/1c/dc/1f5489f7b21817d4ad352bf7a92a252bd5b438bcbaa7ad20ea50814edc79/onnxruntime-1.24.3-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a9847b870b6cb462652b547bc98c49e0efb67553410a082fde1918a38707452", size = 15150105, upload-time = "2026-03-05T16:34:56.897Z" }, + { url = "https://files.pythonhosted.org/packages/28/7c/fd253da53594ab8efbefdc85b3638620ab1a6aab6eb7028a513c853559ce/onnxruntime-1.24.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b354afce3333f2859c7e8706d84b6c552beac39233bcd3141ce7ab77b4cabb5d", size = 17237101, upload-time = "2026-03-05T17:18:02.561Z" }, + { url = "https://files.pythonhosted.org/packages/71/5f/eaabc5699eeed6a9188c5c055ac1948ae50138697a0428d562ac970d7db5/onnxruntime-1.24.3-cp312-cp312-win_amd64.whl", hash = "sha256:44ea708c34965439170d811267c51281d3897ecfc4aa0087fa25d4a4c3eb2e4a", size = 12597638, upload-time = "2026-03-05T17:18:52.141Z" }, + { url = "https://files.pythonhosted.org/packages/cc/5c/d8066c320b90610dbeb489a483b132c3b3879b2f93f949fb5d30cfa9b119/onnxruntime-1.24.3-cp312-cp312-win_arm64.whl", hash = "sha256:48d1092b44ca2ba6f9543892e7c422c15a568481403c10440945685faf27a8d8", size = 12270943, upload-time = "2026-03-05T17:18:42.006Z" }, + { url = "https://files.pythonhosted.org/packages/51/8d/487ece554119e2991242d4de55de7019ac6e47ee8dfafa69fcf41d37f8ed/onnxruntime-1.24.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:34a0ea5ff191d8420d9c1332355644148b1bf1a0d10c411af890a63a9f662aa7", size = 17342706, upload-time = "2026-03-05T16:35:10.813Z" }, + { url = "https://files.pythonhosted.org/packages/dd/25/8b444f463c1ac6106b889f6235c84f01eec001eaf689c3eff8c69cf48fae/onnxruntime-1.24.3-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1fd2ec7bb0fabe42f55e8337cfc9b1969d0d14622711aac73d69b4bd5abb5ed7", size = 15149956, upload-time = "2026-03-05T16:34:59.264Z" }, + { url = "https://files.pythonhosted.org/packages/34/fc/c9182a3e1ab46940dd4f30e61071f59eee8804c1f641f37ce6e173633fb6/onnxruntime-1.24.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:df8e70e732fe26346faaeec9147fa38bef35d232d2495d27e93dd221a2d473a9", size = 17237370, upload-time = "2026-03-05T17:18:05.258Z" }, + { url = "https://files.pythonhosted.org/packages/05/7e/3b549e1f4538514118bff98a1bcd6481dd9a17067f8c9af77151621c9a5c/onnxruntime-1.24.3-cp313-cp313-win_amd64.whl", hash = "sha256:2d3706719be6ad41d38a2250998b1d87758a20f6ea4546962e21dc79f1f1fd2b", size = 12597939, upload-time = "2026-03-05T17:18:54.772Z" }, + { url = "https://files.pythonhosted.org/packages/80/41/9696a5c4631a0caa75cc8bc4efd30938fd483694aa614898d087c3ee6d29/onnxruntime-1.24.3-cp313-cp313-win_arm64.whl", hash = "sha256:b082f3ba9519f0a1a1e754556bc7e635c7526ef81b98b3f78da4455d25f0437b", size = 12270705, upload-time = "2026-03-05T17:18:44.774Z" }, + { url = "https://files.pythonhosted.org/packages/b7/65/a26c5e59e3b210852ee04248cf8843c81fe7d40d94cf95343b66efe7eec9/onnxruntime-1.24.3-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:72f956634bc2e4bd2e8b006bef111849bd42c42dea37bd0a4c728404fdaf4d34", size = 15161796, upload-time = "2026-03-05T16:35:02.871Z" }, + { url = "https://files.pythonhosted.org/packages/f3/25/2035b4aa2ccb5be6acf139397731ec507c5f09e199ab39d3262b22ffa1ac/onnxruntime-1.24.3-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:78d1f25eed4ab9959db70a626ed50ee24cf497e60774f59f1207ac8556399c4d", size = 17240936, upload-time = "2026-03-05T17:18:09.534Z" }, + { url = "https://files.pythonhosted.org/packages/f9/a4/b3240ea84b92a3efb83d49cc16c04a17ade1ab47a6a95c4866d15bf0ac35/onnxruntime-1.24.3-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:a6b4bce87d96f78f0a9bf5cefab3303ae95d558c5bfea53d0bf7f9ea207880a8", size = 17344149, upload-time = "2026-03-05T16:35:13.382Z" }, + { url = "https://files.pythonhosted.org/packages/bb/4a/4b56757e51a56265e8c56764d9c36d7b435045e05e3b8a38bedfc5aedba3/onnxruntime-1.24.3-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d48f36c87b25ab3b2b4c88826c96cf1399a5631e3c2c03cc27d6a1e5d6b18eb4", size = 15151571, upload-time = "2026-03-05T16:35:05.679Z" }, + { url = "https://files.pythonhosted.org/packages/cf/14/c6fb84980cec8f682a523fcac7c2bdd6b311e7f342c61ce48d3a9cb87fc6/onnxruntime-1.24.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e104d33a409bf6e3f30f0e8198ec2aaf8d445b8395490a80f6e6ad56da98e400", size = 17238951, upload-time = "2026-03-05T17:18:12.394Z" }, + { url = "https://files.pythonhosted.org/packages/57/14/447e1400165aca8caf35dabd46540eb943c92f3065927bb4d9bcbc91e221/onnxruntime-1.24.3-cp314-cp314-win_amd64.whl", hash = "sha256:e785d73fbd17421c2513b0bb09eb25d88fa22c8c10c3f5d6060589efa5537c5b", size = 12903820, upload-time = "2026-03-05T17:18:57.123Z" }, + { url = "https://files.pythonhosted.org/packages/1d/ec/6b2fa5702e4bbba7339ca5787a9d056fc564a16079f8833cc6ba4798da1c/onnxruntime-1.24.3-cp314-cp314-win_arm64.whl", hash = "sha256:951e897a275f897a05ffbcaa615d98777882decaeb80c9216c68cdc62f849f53", size = 12594089, upload-time = "2026-03-05T17:18:47.169Z" }, + { url = "https://files.pythonhosted.org/packages/12/dc/cd06cba3ddad92ceb17b914a8e8d49836c79e38936e26bde6e368b62c1fe/onnxruntime-1.24.3-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4d4e70ce578aa214c74c7a7a9226bc8e229814db4a5b2d097333b81279ecde36", size = 15162789, upload-time = "2026-03-05T16:35:08.282Z" }, + { url = "https://files.pythonhosted.org/packages/a6/d6/413e98ab666c6fb9e8be7d1c6eb3bd403b0bea1b8d42db066dab98c7df07/onnxruntime-1.24.3-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:02aaf6ddfa784523b6873b4176a79d508e599efe12ab0ea1a3a6e7314408b7aa", size = 17240738, upload-time = "2026-03-05T17:18:15.203Z" }, +] + +[[package]] +name = "opt-einsum" +version = "3.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "numpy", version = "2.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/bf/9257e53a0e7715bc1127e15063e831f076723c6cd60985333a1c18878fb8/opt_einsum-3.3.0.tar.gz", hash = "sha256:59f6475f77bbc37dcf7cd748519c0ec60722e91e63ca114e68821c0c54a46549", size = 73951, upload-time = "2020-07-19T22:40:32.141Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl", hash = "sha256:2455e59e3947d3c275477df7f5205b30635e266fe6dc300e3d9f9646bfcea147", size = 65486, upload-time = "2020-07-19T22:40:30.301Z" }, +] + +[[package]] +name = "packaging" +version = "26.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4", size = 143416, upload-time = "2026-01-21T20:50:39.064Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" }, +] + +[[package]] +name = "paddle2onnx" +source = { editable = "." } +dependencies = [ + { name = "onnx" }, + { name = "onnxoptimizer" }, + { name = "paddlepaddle" }, + { name = "polygraphy" }, +] + +[package.dev-dependencies] +dev = [ + { name = "mypy" }, + { name = "pytest" }, + { name = "ruff" }, +] +test = [ + { name = "hypothesis" }, + { name = "onnxruntime" }, + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [ + { name = "onnx", specifier = ">=1.20.1,<2" }, + { name = "onnxoptimizer", specifier = ">=0.3.13" }, + { name = "paddlepaddle", specifier = ">=3.3,<4" }, + { name = "polygraphy", specifier = ">=0.49.20,<1" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "mypy", specifier = ">=1.15,<2" }, + { name = "pytest", specifier = ">=8,<9" }, + { name = "ruff", specifier = ">=0.11,<1" }, +] +test = [ + { name = "hypothesis", specifier = ">=6,<7" }, + { name = "onnxruntime", specifier = ">=1.20,<2" }, + { name = "pytest", specifier = ">=8,<9" }, +] + +[[package]] +name = "paddlepaddle" +version = "3.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "httpx" }, + { name = "networkx", version = "3.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "networkx", version = "3.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "numpy", version = "2.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "opt-einsum" }, + { name = "pillow" }, + { name = "protobuf" }, + { name = "safetensors" }, + { name = "setuptools", marker = "python_full_version >= '3.12'" }, + { name = "typing-extensions" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/0a/ac/20f5107136e903430a0a405c395d68a07a44d29002cf5af6ed7d9a46dc63/paddlepaddle-3.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d7829960c98fdff2fe9be8fe5500e43a6365e31a5f1025bd1108f636361e0f1a", size = 103656753, upload-time = "2026-01-13T09:14:12.305Z" }, + { url = "https://files.pythonhosted.org/packages/ea/d5/ce19b6c204e6180362d31baf910ed7240d488ea4e08b0f34baff55a5f7c3/paddlepaddle-3.3.0-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:2c8507b5cec35286e05ba67100edcb4e528bdd80be03d40bbac2a1396e03fc70", size = 193697833, upload-time = "2026-01-13T08:54:12.398Z" }, + { url = "https://files.pythonhosted.org/packages/5a/4b/7aa9eed9c9cfcc882d7ba745aa13d3e7749abedaaebe1535dfb3815b45e4/paddlepaddle-3.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:87a9fe86bd6f5932f09f14c2326dd1a4896bba1caac999cfcd38b93f5ead5027", size = 104257759, upload-time = "2026-01-13T09:32:17.534Z" }, + { url = "https://files.pythonhosted.org/packages/89/a3/e137deefdde591291d971f082e3089561460934e2844ececd19bb13a8099/paddlepaddle-3.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ccc6d259c75f91e0baded01f89f35d64c1bbd84477d81461bd3f6c5b7abc1918", size = 103662106, upload-time = "2026-01-13T09:16:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/64/1b/2af5dfe38f7b062ebcc89abca798288ece19dff6aaf51290bda1840ce809/paddlepaddle-3.3.0-cp311-cp311-manylinux1_x86_64.whl", hash = "sha256:a4f2e0595e827c179b4fff4278fb41a24f4abe5927ffd5efb1ace26a916145f2", size = 193703893, upload-time = "2026-01-13T08:58:01.075Z" }, + { url = "https://files.pythonhosted.org/packages/53/62/79dd3233fd28bc7950bcabf57ee32eeb88d6c758a35111dd25af6a6fe216/paddlepaddle-3.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:ad1b946dd4ea035c268dd6c5468bac9cad15baf81f2f6bd49e803858c041f4da", size = 104266905, upload-time = "2026-01-13T09:34:34.528Z" }, + { url = "https://files.pythonhosted.org/packages/22/07/1aacbce9ad8989c621d4cbd91945dd1d6ed01b315f46f925fb4bbcabb971/paddlepaddle-3.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:17aab6b90d8cef2ccf893f4be82cf05e906e21fe86c40a34fea6701937d7782b", size = 103701539, upload-time = "2026-01-13T09:19:10.174Z" }, + { url = "https://files.pythonhosted.org/packages/7e/ad/93342171c84f95331b2823c57b77de5aa80b13079927f3fdee5eee459f8b/paddlepaddle-3.3.0-cp312-cp312-manylinux1_x86_64.whl", hash = "sha256:3ee996ee2bf2d2b33e9865876fb82ff03cb7bb2246cc5aa0027edd6a9a0640eb", size = 193740207, upload-time = "2026-01-13T09:01:48.188Z" }, + { url = "https://files.pythonhosted.org/packages/12/52/632b1013923a67cbcc778e6e1a308f3848f699f80024a737940e5e17b52a/paddlepaddle-3.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:f19a6a0728103b6b6b6b85726ac39fb77277d72ffff08d66ca3a8a97f0759a02", size = 104281149, upload-time = "2026-01-13T09:36:51.506Z" }, + { url = "https://files.pythonhosted.org/packages/1c/ea/909737cf298cdbdaa2b2a9b16961e3883802cc600f9b7dc8331e5f80e374/paddlepaddle-3.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:b56781354b18063f43a87f3d562ada5a4f8a437fe2312ab1032fa89ad5a54ec0", size = 103703459, upload-time = "2026-01-13T09:21:39.399Z" }, + { url = "https://files.pythonhosted.org/packages/0d/b7/1d9e9170a5efc3a2188df6899b4279d650be222b0987cbfe0f14668b467b/paddlepaddle-3.3.0-cp313-cp313-manylinux1_x86_64.whl", hash = "sha256:88898274f5cd5e2f4ebaf5631d4c00927d9d58465a083875c224b40f9935cd39", size = 193732176, upload-time = "2026-01-13T09:05:36.068Z" }, + { url = "https://files.pythonhosted.org/packages/8c/1c/04d8fa9181cb0ec409271ab35c496c0fd0641ba9e8ffd118d15358791f93/paddlepaddle-3.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:e999a2dcdb33597f2ddf8971f4eec362bc1a21c347ffaeae9ddeea9f0f51c9dd", size = 104279406, upload-time = "2026-01-13T09:39:09.178Z" }, +] + +[[package]] +name = "pathspec" +version = "1.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload-time = "2026-01-27T03:59:46.938Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload-time = "2026-01-27T03:59:45.137Z" }, +] + +[[package]] +name = "pillow" +version = "12.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1f/42/5c74462b4fd957fcd7b13b04fb3205ff8349236ea74c7c375766d6c82288/pillow-12.1.1.tar.gz", hash = "sha256:9ad8fa5937ab05218e2b6a4cff30295ad35afd2f83ac592e68c0d871bb0fdbc4", size = 46980264, upload-time = "2026-02-11T04:23:07.146Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1d/30/5bd3d794762481f8c8ae9c80e7b76ecea73b916959eb587521358ef0b2f9/pillow-12.1.1-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:1f1625b72740fdda5d77b4def688eb8fd6490975d06b909fd19f13f391e077e0", size = 5304099, upload-time = "2026-02-11T04:20:06.13Z" }, + { url = "https://files.pythonhosted.org/packages/bd/c1/aab9e8f3eeb4490180e357955e15c2ef74b31f64790ff356c06fb6cf6d84/pillow-12.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:178aa072084bd88ec759052feca8e56cbb14a60b39322b99a049e58090479713", size = 4657880, upload-time = "2026-02-11T04:20:09.291Z" }, + { url = "https://files.pythonhosted.org/packages/f1/0a/9879e30d56815ad529d3985aeff5af4964202425c27261a6ada10f7cbf53/pillow-12.1.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b66e95d05ba806247aaa1561f080abc7975daf715c30780ff92a20e4ec546e1b", size = 6222587, upload-time = "2026-02-11T04:20:10.82Z" }, + { url = "https://files.pythonhosted.org/packages/5a/5f/a1b72ff7139e4f89014e8d451442c74a774d5c43cd938fb0a9f878576b37/pillow-12.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:89c7e895002bbe49cdc5426150377cbbc04767d7547ed145473f496dfa40408b", size = 8027678, upload-time = "2026-02-11T04:20:12.455Z" }, + { url = "https://files.pythonhosted.org/packages/e2/c2/c7cb187dac79a3d22c3ebeae727abee01e077c8c7d930791dc592f335153/pillow-12.1.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a5cbdcddad0af3da87cb16b60d23648bc3b51967eb07223e9fed77a82b457c4", size = 6335777, upload-time = "2026-02-11T04:20:14.441Z" }, + { url = "https://files.pythonhosted.org/packages/0c/7b/f9b09a7804ec7336effb96c26d37c29d27225783dc1501b7d62dcef6ae25/pillow-12.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9f51079765661884a486727f0729d29054242f74b46186026582b4e4769918e4", size = 7027140, upload-time = "2026-02-11T04:20:16.387Z" }, + { url = "https://files.pythonhosted.org/packages/98/b2/2fa3c391550bd421b10849d1a2144c44abcd966daadd2f7c12e19ea988c4/pillow-12.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:99c1506ea77c11531d75e3a412832a13a71c7ebc8192ab9e4b2e355555920e3e", size = 6449855, upload-time = "2026-02-11T04:20:18.554Z" }, + { url = "https://files.pythonhosted.org/packages/96/ff/9caf4b5b950c669263c39e96c78c0d74a342c71c4f43fd031bb5cb7ceac9/pillow-12.1.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:36341d06738a9f66c8287cf8b876d24b18db9bd8740fa0672c74e259ad408cff", size = 7151329, upload-time = "2026-02-11T04:20:20.646Z" }, + { url = "https://files.pythonhosted.org/packages/7b/f8/4b24841f582704da675ca535935bccb32b00a6da1226820845fac4a71136/pillow-12.1.1-cp310-cp310-win32.whl", hash = "sha256:6c52f062424c523d6c4db85518774cc3d50f5539dd6eed32b8f6229b26f24d40", size = 6325574, upload-time = "2026-02-11T04:20:22.43Z" }, + { url = "https://files.pythonhosted.org/packages/f8/f9/9f6b01c0881d7036063aa6612ef04c0e2cad96be21325a1e92d0203f8e91/pillow-12.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:c6008de247150668a705a6338156efb92334113421ceecf7438a12c9a12dab23", size = 7032347, upload-time = "2026-02-11T04:20:23.932Z" }, + { url = "https://files.pythonhosted.org/packages/79/13/c7922edded3dcdaf10c59297540b72785620abc0538872c819915746757d/pillow-12.1.1-cp310-cp310-win_arm64.whl", hash = "sha256:1a9b0ee305220b392e1124a764ee4265bd063e54a751a6b62eff69992f457fa9", size = 2453457, upload-time = "2026-02-11T04:20:25.392Z" }, + { url = "https://files.pythonhosted.org/packages/2b/46/5da1ec4a5171ee7bf1a0efa064aba70ba3d6e0788ce3f5acd1375d23c8c0/pillow-12.1.1-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:e879bb6cd5c73848ef3b2b48b8af9ff08c5b71ecda8048b7dd22d8a33f60be32", size = 5304084, upload-time = "2026-02-11T04:20:27.501Z" }, + { url = "https://files.pythonhosted.org/packages/78/93/a29e9bc02d1cf557a834da780ceccd54e02421627200696fcf805ebdc3fb/pillow-12.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:365b10bb9417dd4498c0e3b128018c4a624dc11c7b97d8cc54effe3b096f4c38", size = 4657866, upload-time = "2026-02-11T04:20:29.827Z" }, + { url = "https://files.pythonhosted.org/packages/13/84/583a4558d492a179d31e4aae32eadce94b9acf49c0337c4ce0b70e0a01f2/pillow-12.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d4ce8e329c93845720cd2014659ca67eac35f6433fd3050393d85f3ecef0dad5", size = 6232148, upload-time = "2026-02-11T04:20:31.329Z" }, + { url = "https://files.pythonhosted.org/packages/d5/e2/53c43334bbbb2d3b938978532fbda8e62bb6e0b23a26ce8592f36bcc4987/pillow-12.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc354a04072b765eccf2204f588a7a532c9511e8b9c7f900e1b64e3e33487090", size = 8038007, upload-time = "2026-02-11T04:20:34.225Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a6/3d0e79c8a9d58150dd98e199d7c1c56861027f3829a3a60b3c2784190180/pillow-12.1.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7e7976bf1910a8116b523b9f9f58bf410f3e8aa330cd9a2bb2953f9266ab49af", size = 6345418, upload-time = "2026-02-11T04:20:35.858Z" }, + { url = "https://files.pythonhosted.org/packages/a2/c8/46dfeac5825e600579157eea177be43e2f7ff4a99da9d0d0a49533509ac5/pillow-12.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:597bd9c8419bc7c6af5604e55847789b69123bbe25d65cc6ad3012b4f3c98d8b", size = 7034590, upload-time = "2026-02-11T04:20:37.91Z" }, + { url = "https://files.pythonhosted.org/packages/af/bf/e6f65d3db8a8bbfeaf9e13cc0417813f6319863a73de934f14b2229ada18/pillow-12.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2c1fc0f2ca5f96a3c8407e41cca26a16e46b21060fe6d5b099d2cb01412222f5", size = 6458655, upload-time = "2026-02-11T04:20:39.496Z" }, + { url = "https://files.pythonhosted.org/packages/f9/c2/66091f3f34a25894ca129362e510b956ef26f8fb67a0e6417bc5744e56f1/pillow-12.1.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:578510d88c6229d735855e1f278aa305270438d36a05031dfaae5067cc8eb04d", size = 7159286, upload-time = "2026-02-11T04:20:41.139Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5a/24bc8eb526a22f957d0cec6243146744966d40857e3d8deb68f7902ca6c1/pillow-12.1.1-cp311-cp311-win32.whl", hash = "sha256:7311c0a0dcadb89b36b7025dfd8326ecfa36964e29913074d47382706e516a7c", size = 6328663, upload-time = "2026-02-11T04:20:43.184Z" }, + { url = "https://files.pythonhosted.org/packages/31/03/bef822e4f2d8f9d7448c133d0a18185d3cce3e70472774fffefe8b0ed562/pillow-12.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:fbfa2a7c10cc2623f412753cddf391c7f971c52ca40a3f65dc5039b2939e8563", size = 7031448, upload-time = "2026-02-11T04:20:44.696Z" }, + { url = "https://files.pythonhosted.org/packages/49/70/f76296f53610bd17b2e7d31728b8b7825e3ac3b5b3688b51f52eab7c0818/pillow-12.1.1-cp311-cp311-win_arm64.whl", hash = "sha256:b81b5e3511211631b3f672a595e3221252c90af017e399056d0faabb9538aa80", size = 2453651, upload-time = "2026-02-11T04:20:46.243Z" }, + { url = "https://files.pythonhosted.org/packages/07/d3/8df65da0d4df36b094351dce696f2989bec731d4f10e743b1c5f4da4d3bf/pillow-12.1.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ab323b787d6e18b3d91a72fc99b1a2c28651e4358749842b8f8dfacd28ef2052", size = 5262803, upload-time = "2026-02-11T04:20:47.653Z" }, + { url = "https://files.pythonhosted.org/packages/d6/71/5026395b290ff404b836e636f51d7297e6c83beceaa87c592718747e670f/pillow-12.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:adebb5bee0f0af4909c30db0d890c773d1a92ffe83da908e2e9e720f8edf3984", size = 4657601, upload-time = "2026-02-11T04:20:49.328Z" }, + { url = "https://files.pythonhosted.org/packages/b1/2e/1001613d941c67442f745aff0f7cc66dd8df9a9c084eb497e6a543ee6f7e/pillow-12.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:bb66b7cc26f50977108790e2456b7921e773f23db5630261102233eb355a3b79", size = 6234995, upload-time = "2026-02-11T04:20:51.032Z" }, + { url = "https://files.pythonhosted.org/packages/07/26/246ab11455b2549b9233dbd44d358d033a2f780fa9007b61a913c5b2d24e/pillow-12.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aee2810642b2898bb187ced9b349e95d2a7272930796e022efaf12e99dccd293", size = 8045012, upload-time = "2026-02-11T04:20:52.882Z" }, + { url = "https://files.pythonhosted.org/packages/b2/8b/07587069c27be7535ac1fe33874e32de118fbd34e2a73b7f83436a88368c/pillow-12.1.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a0b1cd6232e2b618adcc54d9882e4e662a089d5768cd188f7c245b4c8c44a397", size = 6349638, upload-time = "2026-02-11T04:20:54.444Z" }, + { url = "https://files.pythonhosted.org/packages/ff/79/6df7b2ee763d619cda2fb4fea498e5f79d984dae304d45a8999b80d6cf5c/pillow-12.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7aac39bcf8d4770d089588a2e1dd111cbaa42df5a94be3114222057d68336bd0", size = 7041540, upload-time = "2026-02-11T04:20:55.97Z" }, + { url = "https://files.pythonhosted.org/packages/2c/5e/2ba19e7e7236d7529f4d873bdaf317a318896bac289abebd4bb00ef247f0/pillow-12.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ab174cd7d29a62dd139c44bf74b698039328f45cb03b4596c43473a46656b2f3", size = 6462613, upload-time = "2026-02-11T04:20:57.542Z" }, + { url = "https://files.pythonhosted.org/packages/03/03/31216ec124bb5c3dacd74ce8efff4cc7f52643653bad4825f8f08c697743/pillow-12.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:339ffdcb7cbeaa08221cd401d517d4b1fe7a9ed5d400e4a8039719238620ca35", size = 7166745, upload-time = "2026-02-11T04:20:59.196Z" }, + { url = "https://files.pythonhosted.org/packages/1f/e7/7c4552d80052337eb28653b617eafdef39adfb137c49dd7e831b8dc13bc5/pillow-12.1.1-cp312-cp312-win32.whl", hash = "sha256:5d1f9575a12bed9e9eedd9a4972834b08c97a352bd17955ccdebfeca5913fa0a", size = 6328823, upload-time = "2026-02-11T04:21:01.385Z" }, + { url = "https://files.pythonhosted.org/packages/3d/17/688626d192d7261bbbf98846fc98995726bddc2c945344b65bec3a29d731/pillow-12.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:21329ec8c96c6e979cd0dfd29406c40c1d52521a90544463057d2aaa937d66a6", size = 7033367, upload-time = "2026-02-11T04:21:03.536Z" }, + { url = "https://files.pythonhosted.org/packages/ed/fe/a0ef1f73f939b0eca03ee2c108d0043a87468664770612602c63266a43c4/pillow-12.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:af9a332e572978f0218686636610555ae3defd1633597be015ed50289a03c523", size = 2453811, upload-time = "2026-02-11T04:21:05.116Z" }, + { url = "https://files.pythonhosted.org/packages/d5/11/6db24d4bd7685583caeae54b7009584e38da3c3d4488ed4cd25b439de486/pillow-12.1.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:d242e8ac078781f1de88bf823d70c1a9b3c7950a44cdf4b7c012e22ccbcd8e4e", size = 4062689, upload-time = "2026-02-11T04:21:06.804Z" }, + { url = "https://files.pythonhosted.org/packages/33/c0/ce6d3b1fe190f0021203e0d9b5b99e57843e345f15f9ef22fcd43842fd21/pillow-12.1.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:02f84dfad02693676692746df05b89cf25597560db2857363a208e393429f5e9", size = 4138535, upload-time = "2026-02-11T04:21:08.452Z" }, + { url = "https://files.pythonhosted.org/packages/a0/c6/d5eb6a4fb32a3f9c21a8c7613ec706534ea1cf9f4b3663e99f0d83f6fca8/pillow-12.1.1-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:e65498daf4b583091ccbb2556c7000abf0f3349fcd57ef7adc9a84a394ed29f6", size = 3601364, upload-time = "2026-02-11T04:21:10.194Z" }, + { url = "https://files.pythonhosted.org/packages/14/a1/16c4b823838ba4c9c52c0e6bbda903a3fe5a1bdbf1b8eb4fff7156f3e318/pillow-12.1.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6c6db3b84c87d48d0088943bf33440e0c42370b99b1c2a7989216f7b42eede60", size = 5262561, upload-time = "2026-02-11T04:21:11.742Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ad/ad9dc98ff24f485008aa5cdedaf1a219876f6f6c42a4626c08bc4e80b120/pillow-12.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8b7e5304e34942bf62e15184219a7b5ad4ff7f3bb5cca4d984f37df1a0e1aee2", size = 4657460, upload-time = "2026-02-11T04:21:13.786Z" }, + { url = "https://files.pythonhosted.org/packages/9e/1b/f1a4ea9a895b5732152789326202a82464d5254759fbacae4deea3069334/pillow-12.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:18e5bddd742a44b7e6b1e773ab5db102bd7a94c32555ba656e76d319d19c3850", size = 6232698, upload-time = "2026-02-11T04:21:15.949Z" }, + { url = "https://files.pythonhosted.org/packages/95/f4/86f51b8745070daf21fd2e5b1fe0eb35d4db9ca26e6d58366562fb56a743/pillow-12.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc44ef1f3de4f45b50ccf9136999d71abb99dca7706bc75d222ed350b9fd2289", size = 8041706, upload-time = "2026-02-11T04:21:17.723Z" }, + { url = "https://files.pythonhosted.org/packages/29/9b/d6ecd956bb1266dd1045e995cce9b8d77759e740953a1c9aad9502a0461e/pillow-12.1.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5a8eb7ed8d4198bccbd07058416eeec51686b498e784eda166395a23eb99138e", size = 6346621, upload-time = "2026-02-11T04:21:19.547Z" }, + { url = "https://files.pythonhosted.org/packages/71/24/538bff45bde96535d7d998c6fed1a751c75ac7c53c37c90dc2601b243893/pillow-12.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:47b94983da0c642de92ced1702c5b6c292a84bd3a8e1d1702ff923f183594717", size = 7038069, upload-time = "2026-02-11T04:21:21.378Z" }, + { url = "https://files.pythonhosted.org/packages/94/0e/58cb1a6bc48f746bc4cb3adb8cabff73e2742c92b3bf7a220b7cf69b9177/pillow-12.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:518a48c2aab7ce596d3bf79d0e275661b846e86e4d0e7dec34712c30fe07f02a", size = 6460040, upload-time = "2026-02-11T04:21:23.148Z" }, + { url = "https://files.pythonhosted.org/packages/6c/57/9045cb3ff11eeb6c1adce3b2d60d7d299d7b273a2e6c8381a524abfdc474/pillow-12.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a550ae29b95c6dc13cf69e2c9dc5747f814c54eeb2e32d683e5e93af56caa029", size = 7164523, upload-time = "2026-02-11T04:21:25.01Z" }, + { url = "https://files.pythonhosted.org/packages/73/f2/9be9cb99f2175f0d4dbadd6616ce1bf068ee54a28277ea1bf1fbf729c250/pillow-12.1.1-cp313-cp313-win32.whl", hash = "sha256:a003d7422449f6d1e3a34e3dd4110c22148336918ddbfc6a32581cd54b2e0b2b", size = 6332552, upload-time = "2026-02-11T04:21:27.238Z" }, + { url = "https://files.pythonhosted.org/packages/3f/eb/b0834ad8b583d7d9d42b80becff092082a1c3c156bb582590fcc973f1c7c/pillow-12.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:344cf1e3dab3be4b1fa08e449323d98a2a3f819ad20f4b22e77a0ede31f0faa1", size = 7040108, upload-time = "2026-02-11T04:21:29.462Z" }, + { url = "https://files.pythonhosted.org/packages/d5/7d/fc09634e2aabdd0feabaff4a32f4a7d97789223e7c2042fd805ea4b4d2c2/pillow-12.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:5c0dd1636633e7e6a0afe7bf6a51a14992b7f8e60de5789018ebbdfae55b040a", size = 2453712, upload-time = "2026-02-11T04:21:31.072Z" }, + { url = "https://files.pythonhosted.org/packages/19/2a/b9d62794fc8a0dd14c1943df68347badbd5511103e0d04c035ffe5cf2255/pillow-12.1.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0330d233c1a0ead844fc097a7d16c0abff4c12e856c0b325f231820fee1f39da", size = 5264880, upload-time = "2026-02-11T04:21:32.865Z" }, + { url = "https://files.pythonhosted.org/packages/26/9d/e03d857d1347fa5ed9247e123fcd2a97b6220e15e9cb73ca0a8d91702c6e/pillow-12.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5dae5f21afb91322f2ff791895ddd8889e5e947ff59f71b46041c8ce6db790bc", size = 4660616, upload-time = "2026-02-11T04:21:34.97Z" }, + { url = "https://files.pythonhosted.org/packages/f7/ec/8a6d22afd02570d30954e043f09c32772bfe143ba9285e2fdb11284952cd/pillow-12.1.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2e0c664be47252947d870ac0d327fea7e63985a08794758aa8af5b6cb6ec0c9c", size = 6269008, upload-time = "2026-02-11T04:21:36.623Z" }, + { url = "https://files.pythonhosted.org/packages/3d/1d/6d875422c9f28a4a361f495a5f68d9de4a66941dc2c619103ca335fa6446/pillow-12.1.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:691ab2ac363b8217f7d31b3497108fb1f50faab2f75dfb03284ec2f217e87bf8", size = 8073226, upload-time = "2026-02-11T04:21:38.585Z" }, + { url = "https://files.pythonhosted.org/packages/a1/cd/134b0b6ee5eda6dc09e25e24b40fdafe11a520bc725c1d0bbaa5e00bf95b/pillow-12.1.1-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e9e8064fb1cc019296958595f6db671fba95209e3ceb0c4734c9baf97de04b20", size = 6380136, upload-time = "2026-02-11T04:21:40.562Z" }, + { url = "https://files.pythonhosted.org/packages/7a/a9/7628f013f18f001c1b98d8fffe3452f306a70dc6aba7d931019e0492f45e/pillow-12.1.1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:472a8d7ded663e6162dafdf20015c486a7009483ca671cece7a9279b512fcb13", size = 7067129, upload-time = "2026-02-11T04:21:42.521Z" }, + { url = "https://files.pythonhosted.org/packages/1e/f8/66ab30a2193b277785601e82ee2d49f68ea575d9637e5e234faaa98efa4c/pillow-12.1.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:89b54027a766529136a06cfebeecb3a04900397a3590fd252160b888479517bf", size = 6491807, upload-time = "2026-02-11T04:21:44.22Z" }, + { url = "https://files.pythonhosted.org/packages/da/0b/a877a6627dc8318fdb84e357c5e1a758c0941ab1ddffdafd231983788579/pillow-12.1.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:86172b0831b82ce4f7877f280055892b31179e1576aa00d0df3bb1bbf8c3e524", size = 7190954, upload-time = "2026-02-11T04:21:46.114Z" }, + { url = "https://files.pythonhosted.org/packages/83/43/6f732ff85743cf746b1361b91665d9f5155e1483817f693f8d57ea93147f/pillow-12.1.1-cp313-cp313t-win32.whl", hash = "sha256:44ce27545b6efcf0fdbdceb31c9a5bdea9333e664cda58a7e674bb74608b3986", size = 6336441, upload-time = "2026-02-11T04:21:48.22Z" }, + { url = "https://files.pythonhosted.org/packages/3b/44/e865ef3986611bb75bfabdf94a590016ea327833f434558801122979cd0e/pillow-12.1.1-cp313-cp313t-win_amd64.whl", hash = "sha256:a285e3eb7a5a45a2ff504e31f4a8d1b12ef62e84e5411c6804a42197c1cf586c", size = 7045383, upload-time = "2026-02-11T04:21:50.015Z" }, + { url = "https://files.pythonhosted.org/packages/a8/c6/f4fb24268d0c6908b9f04143697ea18b0379490cb74ba9e8d41b898bd005/pillow-12.1.1-cp313-cp313t-win_arm64.whl", hash = "sha256:cc7d296b5ea4d29e6570dabeaed58d31c3fea35a633a69679fb03d7664f43fb3", size = 2456104, upload-time = "2026-02-11T04:21:51.633Z" }, + { url = "https://files.pythonhosted.org/packages/03/d0/bebb3ffbf31c5a8e97241476c4cf8b9828954693ce6744b4a2326af3e16b/pillow-12.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:417423db963cb4be8bac3fc1204fe61610f6abeed1580a7a2cbb2fbda20f12af", size = 4062652, upload-time = "2026-02-11T04:21:53.19Z" }, + { url = "https://files.pythonhosted.org/packages/2d/c0/0e16fb0addda4851445c28f8350d8c512f09de27bbb0d6d0bbf8b6709605/pillow-12.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:b957b71c6b2387610f556a7eb0828afbe40b4a98036fc0d2acfa5a44a0c2036f", size = 4138823, upload-time = "2026-02-11T04:22:03.088Z" }, + { url = "https://files.pythonhosted.org/packages/6b/fb/6170ec655d6f6bb6630a013dd7cf7bc218423d7b5fa9071bf63dc32175ae/pillow-12.1.1-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:097690ba1f2efdeb165a20469d59d8bb03c55fb6621eb2041a060ae8ea3e9642", size = 3601143, upload-time = "2026-02-11T04:22:04.909Z" }, + { url = "https://files.pythonhosted.org/packages/59/04/dc5c3f297510ba9a6837cbb318b87dd2b8f73eb41a43cc63767f65cb599c/pillow-12.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2815a87ab27848db0321fb78c7f0b2c8649dee134b7f2b80c6a45c6831d75ccd", size = 5266254, upload-time = "2026-02-11T04:22:07.656Z" }, + { url = "https://files.pythonhosted.org/packages/05/30/5db1236b0d6313f03ebf97f5e17cda9ca060f524b2fcc875149a8360b21c/pillow-12.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:f7ed2c6543bad5a7d5530eb9e78c53132f93dfa44a28492db88b41cdab885202", size = 4657499, upload-time = "2026-02-11T04:22:09.613Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/008d2ca0eb612e81968e8be0bbae5051efba24d52debf930126d7eaacbba/pillow-12.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:652a2c9ccfb556235b2b501a3a7cf3742148cd22e04b5625c5fe057ea3e3191f", size = 6232137, upload-time = "2026-02-11T04:22:11.434Z" }, + { url = "https://files.pythonhosted.org/packages/70/f1/f14d5b8eeb4b2cd62b9f9f847eb6605f103df89ef619ac68f92f748614ea/pillow-12.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d6e4571eedf43af33d0fc233a382a76e849badbccdf1ac438841308652a08e1f", size = 8042721, upload-time = "2026-02-11T04:22:13.321Z" }, + { url = "https://files.pythonhosted.org/packages/5a/d6/17824509146e4babbdabf04d8171491fa9d776f7061ff6e727522df9bd03/pillow-12.1.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b574c51cf7d5d62e9be37ba446224b59a2da26dc4c1bb2ecbe936a4fb1a7cb7f", size = 6347798, upload-time = "2026-02-11T04:22:15.449Z" }, + { url = "https://files.pythonhosted.org/packages/d1/ee/c85a38a9ab92037a75615aba572c85ea51e605265036e00c5b67dfafbfe2/pillow-12.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a37691702ed687799de29a518d63d4682d9016932db66d4e90c345831b02fb4e", size = 7039315, upload-time = "2026-02-11T04:22:17.24Z" }, + { url = "https://files.pythonhosted.org/packages/ec/f3/bc8ccc6e08a148290d7523bde4d9a0d6c981db34631390dc6e6ec34cacf6/pillow-12.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f95c00d5d6700b2b890479664a06e754974848afaae5e21beb4d83c106923fd0", size = 6462360, upload-time = "2026-02-11T04:22:19.111Z" }, + { url = "https://files.pythonhosted.org/packages/f6/ab/69a42656adb1d0665ab051eec58a41f169ad295cf81ad45406963105408f/pillow-12.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:559b38da23606e68681337ad74622c4dbba02254fc9cb4488a305dd5975c7eeb", size = 7165438, upload-time = "2026-02-11T04:22:21.041Z" }, + { url = "https://files.pythonhosted.org/packages/02/46/81f7aa8941873f0f01d4b55cc543b0a3d03ec2ee30d617a0448bf6bd6dec/pillow-12.1.1-cp314-cp314-win32.whl", hash = "sha256:03edcc34d688572014ff223c125a3f77fb08091e4607e7745002fc214070b35f", size = 6431503, upload-time = "2026-02-11T04:22:22.833Z" }, + { url = "https://files.pythonhosted.org/packages/40/72/4c245f7d1044b67affc7f134a09ea619d4895333d35322b775b928180044/pillow-12.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:50480dcd74fa63b8e78235957d302d98d98d82ccbfac4c7e12108ba9ecbdba15", size = 7176748, upload-time = "2026-02-11T04:22:24.64Z" }, + { url = "https://files.pythonhosted.org/packages/e4/ad/8a87bdbe038c5c698736e3348af5c2194ffb872ea52f11894c95f9305435/pillow-12.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:5cb1785d97b0c3d1d1a16bc1d710c4a0049daefc4935f3a8f31f827f4d3d2e7f", size = 2544314, upload-time = "2026-02-11T04:22:26.685Z" }, + { url = "https://files.pythonhosted.org/packages/6c/9d/efd18493f9de13b87ede7c47e69184b9e859e4427225ea962e32e56a49bc/pillow-12.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:1f90cff8aa76835cba5769f0b3121a22bd4eb9e6884cfe338216e557a9a548b8", size = 5268612, upload-time = "2026-02-11T04:22:29.884Z" }, + { url = "https://files.pythonhosted.org/packages/f8/f1/4f42eb2b388eb2ffc660dcb7f7b556c1015c53ebd5f7f754965ef997585b/pillow-12.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1f1be78ce9466a7ee64bfda57bdba0f7cc499d9794d518b854816c41bf0aa4e9", size = 4660567, upload-time = "2026-02-11T04:22:31.799Z" }, + { url = "https://files.pythonhosted.org/packages/01/54/df6ef130fa43e4b82e32624a7b821a2be1c5653a5fdad8469687a7db4e00/pillow-12.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:42fc1f4677106188ad9a55562bbade416f8b55456f522430fadab3cef7cd4e60", size = 6269951, upload-time = "2026-02-11T04:22:33.921Z" }, + { url = "https://files.pythonhosted.org/packages/a9/48/618752d06cc44bb4aae8ce0cd4e6426871929ed7b46215638088270d9b34/pillow-12.1.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:98edb152429ab62a1818039744d8fbb3ccab98a7c29fc3d5fcef158f3f1f68b7", size = 8074769, upload-time = "2026-02-11T04:22:35.877Z" }, + { url = "https://files.pythonhosted.org/packages/c3/bd/f1d71eb39a72fa088d938655afba3e00b38018d052752f435838961127d8/pillow-12.1.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d470ab1178551dd17fdba0fef463359c41aaa613cdcd7ff8373f54be629f9f8f", size = 6381358, upload-time = "2026-02-11T04:22:37.698Z" }, + { url = "https://files.pythonhosted.org/packages/64/ef/c784e20b96674ed36a5af839305f55616f8b4f8aa8eeccf8531a6e312243/pillow-12.1.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6408a7b064595afcab0a49393a413732a35788f2a5092fdc6266952ed67de586", size = 7068558, upload-time = "2026-02-11T04:22:39.597Z" }, + { url = "https://files.pythonhosted.org/packages/73/cb/8059688b74422ae61278202c4e1ad992e8a2e7375227be0a21c6b87ca8d5/pillow-12.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5d8c41325b382c07799a3682c1c258469ea2ff97103c53717b7893862d0c98ce", size = 6493028, upload-time = "2026-02-11T04:22:42.73Z" }, + { url = "https://files.pythonhosted.org/packages/c6/da/e3c008ed7d2dd1f905b15949325934510b9d1931e5df999bb15972756818/pillow-12.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c7697918b5be27424e9ce568193efd13d925c4481dd364e43f5dff72d33e10f8", size = 7191940, upload-time = "2026-02-11T04:22:44.543Z" }, + { url = "https://files.pythonhosted.org/packages/01/4a/9202e8d11714c1fc5951f2e1ef362f2d7fbc595e1f6717971d5dd750e969/pillow-12.1.1-cp314-cp314t-win32.whl", hash = "sha256:d2912fd8114fc5545aa3a4b5576512f64c55a03f3ebcca4c10194d593d43ea36", size = 6438736, upload-time = "2026-02-11T04:22:46.347Z" }, + { url = "https://files.pythonhosted.org/packages/f3/ca/cbce2327eb9885476b3957b2e82eb12c866a8b16ad77392864ad601022ce/pillow-12.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:4ceb838d4bd9dab43e06c363cab2eebf63846d6a4aeaea283bbdfd8f1a8ed58b", size = 7182894, upload-time = "2026-02-11T04:22:48.114Z" }, + { url = "https://files.pythonhosted.org/packages/ec/d2/de599c95ba0a973b94410477f8bf0b6f0b5e67360eb89bcb1ad365258beb/pillow-12.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:7b03048319bfc6170e93bd60728a1af51d3dd7704935feb228c4d4faab35d334", size = 2546446, upload-time = "2026-02-11T04:22:50.342Z" }, + { url = "https://files.pythonhosted.org/packages/56/11/5d43209aa4cb58e0cc80127956ff1796a68b928e6324bbf06ef4db34367b/pillow-12.1.1-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:600fd103672b925fe62ed08e0d874ea34d692474df6f4bf7ebe148b30f89f39f", size = 5228606, upload-time = "2026-02-11T04:22:52.106Z" }, + { url = "https://files.pythonhosted.org/packages/5f/d5/3b005b4e4fda6698b371fa6c21b097d4707585d7db99e98d9b0b87ac612a/pillow-12.1.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:665e1b916b043cef294bc54d47bf02d87e13f769bc4bc5fa225a24b3a6c5aca9", size = 4622321, upload-time = "2026-02-11T04:22:53.827Z" }, + { url = "https://files.pythonhosted.org/packages/df/36/ed3ea2d594356fd8037e5a01f6156c74bc8d92dbb0fa60746cc96cabb6e8/pillow-12.1.1-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:495c302af3aad1ca67420ddd5c7bd480c8867ad173528767d906428057a11f0e", size = 5247579, upload-time = "2026-02-11T04:22:56.094Z" }, + { url = "https://files.pythonhosted.org/packages/54/9a/9cc3e029683cf6d20ae5085da0dafc63148e3252c2f13328e553aaa13cfb/pillow-12.1.1-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8fd420ef0c52c88b5a035a0886f367748c72147b2b8f384c9d12656678dfdfa9", size = 6989094, upload-time = "2026-02-11T04:22:58.288Z" }, + { url = "https://files.pythonhosted.org/packages/00/98/fc53ab36da80b88df0967896b6c4b4cd948a0dc5aa40a754266aa3ae48b3/pillow-12.1.1-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f975aa7ef9684ce7e2c18a3aa8f8e2106ce1e46b94ab713d156b2898811651d3", size = 5313850, upload-time = "2026-02-11T04:23:00.554Z" }, + { url = "https://files.pythonhosted.org/packages/30/02/00fa585abfd9fe9d73e5f6e554dc36cc2b842898cbfc46d70353dae227f8/pillow-12.1.1-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8089c852a56c2966cf18835db62d9b34fef7ba74c726ad943928d494fa7f4735", size = 5963343, upload-time = "2026-02-11T04:23:02.934Z" }, + { url = "https://files.pythonhosted.org/packages/f2/26/c56ce33ca856e358d27fda9676c055395abddb82c35ac0f593877ed4562e/pillow-12.1.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:cb9bb857b2d057c6dfc72ac5f3b44836924ba15721882ef103cecb40d002d80e", size = 7029880, upload-time = "2026-02-11T04:23:04.783Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "polygraphy" +version = "0.49.26" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a1/25/e92af58cca8f8f8833d3346506a186938148b7156671c8154d94b8985d35/polygraphy-0.49.26-py2.py3-none-any.whl", hash = "sha256:5787d218a133163b42c92800134afaba6b266127646efb77416a9530137d1a45", size = 372849, upload-time = "2025-07-16T18:26:21.446Z" }, +] + +[[package]] +name = "protobuf" +version = "7.34.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f2/00/04a2ab36b70a52d0356852979e08b44edde0435f2115dc66e25f2100f3ab/protobuf-7.34.0.tar.gz", hash = "sha256:3871a3df67c710aaf7bb8d214cc997342e63ceebd940c8c7fc65c9b3d697591a", size = 454726, upload-time = "2026-02-27T00:30:25.421Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/13/c4/6322ab5c8f279c4c358bc14eb8aefc0550b97222a39f04eb3c1af7a830fa/protobuf-7.34.0-cp310-abi3-macosx_10_9_universal2.whl", hash = "sha256:8e329966799f2c271d5e05e236459fe1cbfdb8755aaa3b0914fa60947ddea408", size = 429248, upload-time = "2026-02-27T00:30:14.924Z" }, + { url = "https://files.pythonhosted.org/packages/45/99/b029bbbc61e8937545da5b79aa405ab2d9cf307a728f8c9459ad60d7a481/protobuf-7.34.0-cp310-abi3-manylinux2014_aarch64.whl", hash = "sha256:9d7a5005fb96f3c1e64f397f91500b0eb371b28da81296ae73a6b08a5b76cdd6", size = 325753, upload-time = "2026-02-27T00:30:17.247Z" }, + { url = "https://files.pythonhosted.org/packages/cc/79/09f02671eb75b251c5550a1c48e7b3d4b0623efd7c95a15a50f6f9fc1e2e/protobuf-7.34.0-cp310-abi3-manylinux2014_s390x.whl", hash = "sha256:4a72a8ec94e7a9f7ef7fe818ed26d073305f347f8b3b5ba31e22f81fd85fca02", size = 340200, upload-time = "2026-02-27T00:30:18.672Z" }, + { url = "https://files.pythonhosted.org/packages/b5/57/89727baef7578897af5ed166735ceb315819f1c184da8c3441271dbcfde7/protobuf-7.34.0-cp310-abi3-manylinux2014_x86_64.whl", hash = "sha256:964cf977e07f479c0697964e83deda72bcbc75c3badab506fb061b352d991b01", size = 324268, upload-time = "2026-02-27T00:30:20.088Z" }, + { url = "https://files.pythonhosted.org/packages/1f/3e/38ff2ddee5cc946f575c9d8cc822e34bde205cf61acf8099ad88ef19d7d2/protobuf-7.34.0-cp310-abi3-win32.whl", hash = "sha256:f791ec509707a1d91bd02e07df157e75e4fb9fbdad12a81b7396201ec244e2e3", size = 426628, upload-time = "2026-02-27T00:30:21.555Z" }, + { url = "https://files.pythonhosted.org/packages/cb/71/7c32eaf34a61a1bae1b62a2ac4ffe09b8d1bb0cf93ad505f42040023db89/protobuf-7.34.0-cp310-abi3-win_amd64.whl", hash = "sha256:9f9079f1dde4e32342ecbd1c118d76367090d4aaa19da78230c38101c5b3dd40", size = 437901, upload-time = "2026-02-27T00:30:22.836Z" }, + { url = "https://files.pythonhosted.org/packages/a4/e7/14dc9366696dcb53a413449881743426ed289d687bcf3d5aee4726c32ebb/protobuf-7.34.0-py3-none-any.whl", hash = "sha256:e3b914dd77fa33fa06ab2baa97937746ab25695f389869afdf03e81f34e45dc7", size = 170716, upload-time = "2026-02-27T00:30:23.994Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pytest" +version = "8.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, +] + +[[package]] +name = "ruff" +version = "0.15.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/77/9b/840e0039e65fcf12758adf684d2289024d6140cde9268cc59887dc55189c/ruff-0.15.5.tar.gz", hash = "sha256:7c3601d3b6d76dce18c5c824fc8d06f4eef33d6df0c21ec7799510cde0f159a2", size = 4574214, upload-time = "2026-03-05T20:06:34.946Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/20/5369c3ce21588c708bcbe517a8fbe1a8dfdb5dfd5137e14790b1da71612c/ruff-0.15.5-py3-none-linux_armv6l.whl", hash = "sha256:4ae44c42281f42e3b06b988e442d344a5b9b72450ff3c892e30d11b29a96a57c", size = 10478185, upload-time = "2026-03-05T20:06:29.093Z" }, + { url = "https://files.pythonhosted.org/packages/44/ed/e81dd668547da281e5dce710cf0bc60193f8d3d43833e8241d006720e42b/ruff-0.15.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6edd3792d408ebcf61adabc01822da687579a1a023f297618ac27a5b51ef0080", size = 10859201, upload-time = "2026-03-05T20:06:32.632Z" }, + { url = "https://files.pythonhosted.org/packages/c4/8f/533075f00aaf19b07c5cd6aa6e5d89424b06b3b3f4583bfa9c640a079059/ruff-0.15.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:89f463f7c8205a9f8dea9d658d59eff49db05f88f89cc3047fb1a02d9f344010", size = 10184752, upload-time = "2026-03-05T20:06:40.312Z" }, + { url = "https://files.pythonhosted.org/packages/66/0e/ba49e2c3fa0395b3152bad634c7432f7edfc509c133b8f4529053ff024fb/ruff-0.15.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba786a8295c6574c1116704cf0b9e6563de3432ac888d8f83685654fe528fd65", size = 10534857, upload-time = "2026-03-05T20:06:19.581Z" }, + { url = "https://files.pythonhosted.org/packages/59/71/39234440f27a226475a0659561adb0d784b4d247dfe7f43ffc12dd02e288/ruff-0.15.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fd4b801e57955fe9f02b31d20375ab3a5c4415f2e5105b79fb94cf2642c91440", size = 10309120, upload-time = "2026-03-05T20:06:00.435Z" }, + { url = "https://files.pythonhosted.org/packages/f5/87/4140aa86a93df032156982b726f4952aaec4a883bb98cb6ef73c347da253/ruff-0.15.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:391f7c73388f3d8c11b794dbbc2959a5b5afe66642c142a6effa90b45f6f5204", size = 11047428, upload-time = "2026-03-05T20:05:51.867Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f7/4953e7e3287676f78fbe85e3a0ca414c5ca81237b7575bdadc00229ac240/ruff-0.15.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dc18f30302e379fe1e998548b0f5e9f4dff907f52f73ad6da419ea9c19d66c8", size = 11914251, upload-time = "2026-03-05T20:06:22.887Z" }, + { url = "https://files.pythonhosted.org/packages/77/46/0f7c865c10cf896ccf5a939c3e84e1cfaeed608ff5249584799a74d33835/ruff-0.15.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1cc6e7f90087e2d27f98dc34ed1b3ab7c8f0d273cc5431415454e22c0bd2a681", size = 11333801, upload-time = "2026-03-05T20:05:57.168Z" }, + { url = "https://files.pythonhosted.org/packages/d3/01/a10fe54b653061585e655f5286c2662ebddb68831ed3eaebfb0eb08c0a16/ruff-0.15.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1cb7169f53c1ddb06e71a9aebd7e98fc0fea936b39afb36d8e86d36ecc2636a", size = 11206821, upload-time = "2026-03-05T20:06:03.441Z" }, + { url = "https://files.pythonhosted.org/packages/7a/0d/2132ceaf20c5e8699aa83da2706ecb5c5dcdf78b453f77edca7fb70f8a93/ruff-0.15.5-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:9b037924500a31ee17389b5c8c4d88874cc6ea8e42f12e9c61a3d754ff72f1ca", size = 11133326, upload-time = "2026-03-05T20:06:25.655Z" }, + { url = "https://files.pythonhosted.org/packages/72/cb/2e5259a7eb2a0f87c08c0fe5bf5825a1e4b90883a52685524596bfc93072/ruff-0.15.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:65bb414e5b4eadd95a8c1e4804f6772bbe8995889f203a01f77ddf2d790929dd", size = 10510820, upload-time = "2026-03-05T20:06:37.79Z" }, + { url = "https://files.pythonhosted.org/packages/ff/20/b67ce78f9e6c59ffbdb5b4503d0090e749b5f2d31b599b554698a80d861c/ruff-0.15.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d20aa469ae3b57033519c559e9bc9cd9e782842e39be05b50e852c7c981fa01d", size = 10302395, upload-time = "2026-03-05T20:05:54.504Z" }, + { url = "https://files.pythonhosted.org/packages/5f/e5/719f1acccd31b720d477751558ed74e9c88134adcc377e5e886af89d3072/ruff-0.15.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:15388dd28c9161cdb8eda68993533acc870aa4e646a0a277aa166de9ad5a8752", size = 10754069, upload-time = "2026-03-05T20:06:06.422Z" }, + { url = "https://files.pythonhosted.org/packages/c3/9c/d1db14469e32d98f3ca27079dbd30b7b44dbb5317d06ab36718dee3baf03/ruff-0.15.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b30da330cbd03bed0c21420b6b953158f60c74c54c5f4c1dabbdf3a57bf355d2", size = 11304315, upload-time = "2026-03-05T20:06:10.867Z" }, + { url = "https://files.pythonhosted.org/packages/28/3a/950367aee7c69027f4f422059227b290ed780366b6aecee5de5039d50fa8/ruff-0.15.5-py3-none-win32.whl", hash = "sha256:732e5ee1f98ba5b3679029989a06ca39a950cced52143a0ea82a2102cb592b74", size = 10551676, upload-time = "2026-03-05T20:06:13.705Z" }, + { url = "https://files.pythonhosted.org/packages/b8/00/bf077a505b4e649bdd3c47ff8ec967735ce2544c8e4a43aba42ee9bf935d/ruff-0.15.5-py3-none-win_amd64.whl", hash = "sha256:821d41c5fa9e19117616c35eaa3f4b75046ec76c65e7ae20a333e9a8696bc7fe", size = 11678972, upload-time = "2026-03-05T20:06:45.379Z" }, + { url = "https://files.pythonhosted.org/packages/fe/4e/cd76eca6db6115604b7626668e891c9dd03330384082e33662fb0f113614/ruff-0.15.5-py3-none-win_arm64.whl", hash = "sha256:b498d1c60d2fe5c10c45ec3f698901065772730b411f164ae270bb6bfcc4740b", size = 10965572, upload-time = "2026-03-05T20:06:16.984Z" }, +] + +[[package]] +name = "safetensors" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/9c/6e74567782559a63bd040a236edca26fd71bc7ba88de2ef35d75df3bca5e/safetensors-0.7.0.tar.gz", hash = "sha256:07663963b67e8bd9f0b8ad15bb9163606cd27cc5a1b96235a50d8369803b96b0", size = 200878, upload-time = "2025-11-19T15:18:43.199Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fa/47/aef6c06649039accf914afef490268e1067ed82be62bcfa5b7e886ad15e8/safetensors-0.7.0-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:c82f4d474cf725255d9e6acf17252991c3c8aac038d6ef363a4bf8be2f6db517", size = 467781, upload-time = "2025-11-19T15:18:35.84Z" }, + { url = "https://files.pythonhosted.org/packages/e8/00/374c0c068e30cd31f1e1b46b4b5738168ec79e7689ca82ee93ddfea05109/safetensors-0.7.0-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:94fd4858284736bb67a897a41608b5b0c2496c9bdb3bf2af1fa3409127f20d57", size = 447058, upload-time = "2025-11-19T15:18:34.416Z" }, + { url = "https://files.pythonhosted.org/packages/f1/06/578ffed52c2296f93d7fd2d844cabfa92be51a587c38c8afbb8ae449ca89/safetensors-0.7.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e07d91d0c92a31200f25351f4acb2bc6aff7f48094e13ebb1d0fb995b54b6542", size = 491748, upload-time = "2025-11-19T15:18:09.79Z" }, + { url = "https://files.pythonhosted.org/packages/ae/33/1debbbb70e4791dde185edb9413d1fe01619255abb64b300157d7f15dddd/safetensors-0.7.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8469155f4cb518bafb4acf4865e8bb9d6804110d2d9bdcaa78564b9fd841e104", size = 503881, upload-time = "2025-11-19T15:18:16.145Z" }, + { url = "https://files.pythonhosted.org/packages/8e/1c/40c2ca924d60792c3be509833df711b553c60effbd91da6f5284a83f7122/safetensors-0.7.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:54bef08bf00a2bff599982f6b08e8770e09cc012d7bba00783fc7ea38f1fb37d", size = 623463, upload-time = "2025-11-19T15:18:21.11Z" }, + { url = "https://files.pythonhosted.org/packages/9b/3a/13784a9364bd43b0d61eef4bea2845039bc2030458b16594a1bd787ae26e/safetensors-0.7.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:42cb091236206bb2016d245c377ed383aa7f78691748f3bb6ee1bfa51ae2ce6a", size = 532855, upload-time = "2025-11-19T15:18:25.719Z" }, + { url = "https://files.pythonhosted.org/packages/a0/60/429e9b1cb3fc651937727befe258ea24122d9663e4d5709a48c9cbfceecb/safetensors-0.7.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac7252938f0696ddea46f5e855dd3138444e82236e3be475f54929f0c510d48", size = 507152, upload-time = "2025-11-19T15:18:33.023Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a8/4b45e4e059270d17af60359713ffd83f97900d45a6afa73aaa0d737d48b6/safetensors-0.7.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1d060c70284127fa805085d8f10fbd0962792aed71879d00864acda69dbab981", size = 541856, upload-time = "2025-11-19T15:18:31.075Z" }, + { url = "https://files.pythonhosted.org/packages/06/87/d26d8407c44175d8ae164a95b5a62707fcc445f3c0c56108e37d98070a3d/safetensors-0.7.0-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:cdab83a366799fa730f90a4ebb563e494f28e9e92c4819e556152ad55e43591b", size = 674060, upload-time = "2025-11-19T15:18:37.211Z" }, + { url = "https://files.pythonhosted.org/packages/11/f5/57644a2ff08dc6325816ba7217e5095f17269dada2554b658442c66aed51/safetensors-0.7.0-cp38-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:672132907fcad9f2aedcb705b2d7b3b93354a2aec1b2f706c4db852abe338f85", size = 771715, upload-time = "2025-11-19T15:18:38.689Z" }, + { url = "https://files.pythonhosted.org/packages/86/31/17883e13a814bd278ae6e266b13282a01049b0c81341da7fd0e3e71a80a3/safetensors-0.7.0-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:5d72abdb8a4d56d4020713724ba81dac065fedb7f3667151c4a637f1d3fb26c0", size = 714377, upload-time = "2025-11-19T15:18:40.162Z" }, + { url = "https://files.pythonhosted.org/packages/4a/d8/0c8a7dc9b41dcac53c4cbf9df2b9c83e0e0097203de8b37a712b345c0be5/safetensors-0.7.0-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b0f6d66c1c538d5a94a73aa9ddca8ccc4227e6c9ff555322ea40bdd142391dd4", size = 677368, upload-time = "2025-11-19T15:18:41.627Z" }, + { url = "https://files.pythonhosted.org/packages/05/e5/cb4b713c8a93469e3c5be7c3f8d77d307e65fe89673e731f5c2bfd0a9237/safetensors-0.7.0-cp38-abi3-win32.whl", hash = "sha256:c74af94bf3ac15ac4d0f2a7c7b4663a15f8c2ab15ed0fc7531ca61d0835eccba", size = 326423, upload-time = "2025-11-19T15:18:45.74Z" }, + { url = "https://files.pythonhosted.org/packages/5d/e6/ec8471c8072382cb91233ba7267fd931219753bb43814cbc71757bfd4dab/safetensors-0.7.0-cp38-abi3-win_amd64.whl", hash = "sha256:d1239932053f56f3456f32eb9625590cc7582e905021f94636202a864d470755", size = 341380, upload-time = "2025-11-19T15:18:44.427Z" }, + { url = "https://files.pythonhosted.org/packages/a7/6a/4d08d89a6fcbe905c5ae68b8b34f0791850882fc19782d0d02c65abbdf3b/safetensors-0.7.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f4729811a6640d019a4b7ba8638ee2fd21fa5ca8c7e7bdf0fed62068fcaac737", size = 492430, upload-time = "2025-11-19T15:18:11.884Z" }, + { url = "https://files.pythonhosted.org/packages/dd/29/59ed8152b30f72c42d00d241e58eaca558ae9dbfa5695206e2e0f54c7063/safetensors-0.7.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:12f49080303fa6bb424b362149a12949dfbbf1e06811a88f2307276b0c131afd", size = 503977, upload-time = "2025-11-19T15:18:17.523Z" }, + { url = "https://files.pythonhosted.org/packages/d3/0b/4811bfec67fa260e791369b16dab105e4bae82686120554cc484064e22b4/safetensors-0.7.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0071bffba4150c2f46cae1432d31995d77acfd9f8db598b5d1a2ce67e8440ad2", size = 623890, upload-time = "2025-11-19T15:18:22.666Z" }, + { url = "https://files.pythonhosted.org/packages/58/5b/632a58724221ef03d78ab65062e82a1010e1bef8e8e0b9d7c6d7b8044841/safetensors-0.7.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:473b32699f4200e69801bf5abf93f1a4ecd432a70984df164fc22ccf39c4a6f3", size = 531885, upload-time = "2025-11-19T15:18:27.146Z" }, +] + +[[package]] +name = "setuptools" +version = "82.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/82/f3/748f4d6f65d1756b9ae577f329c951cda23fb900e4de9f70900ced962085/setuptools-82.0.0.tar.gz", hash = "sha256:22e0a2d69474c6ae4feb01951cb69d515ed23728cf96d05513d36e42b62b37cb", size = 1144893, upload-time = "2026-02-08T15:08:40.206Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e1/c6/76dc613121b793286a3f91621d7b75a2b493e0390ddca50f11993eadf192/setuptools-82.0.0-py3-none-any.whl", hash = "sha256:70b18734b607bd1da571d097d236cfcfacaf01de45717d59e6e04b96877532e0", size = 1003468, upload-time = "2026-02-08T15:08:38.723Z" }, +] + +[[package]] +name = "sortedcontainers" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/c4/ba2f8066cceb6f23394729afe52f3bf7adec04bf9ed2c820b39e19299111/sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", size = 30594, upload-time = "2021-05-16T22:03:42.897Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0", size = 29575, upload-time = "2021-05-16T22:03:41.177Z" }, +] + +[[package]] +name = "sympy" +version = "1.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mpmath" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, +] + +[[package]] +name = "tomli" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/82/30/31573e9457673ab10aa432461bee537ce6cef177667deca369efb79df071/tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c", size = 17477, upload-time = "2026-01-11T11:22:38.165Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3c/d9/3dc2289e1f3b32eb19b9785b6a006b28ee99acb37d1d47f78d4c10e28bf8/tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867", size = 153663, upload-time = "2026-01-11T11:21:45.27Z" }, + { url = "https://files.pythonhosted.org/packages/51/32/ef9f6845e6b9ca392cd3f64f9ec185cc6f09f0a2df3db08cbe8809d1d435/tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9", size = 148469, upload-time = "2026-01-11T11:21:46.873Z" }, + { url = "https://files.pythonhosted.org/packages/d6/c2/506e44cce89a8b1b1e047d64bd495c22c9f71f21e05f380f1a950dd9c217/tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95", size = 236039, upload-time = "2026-01-11T11:21:48.503Z" }, + { url = "https://files.pythonhosted.org/packages/b3/40/e1b65986dbc861b7e986e8ec394598187fa8aee85b1650b01dd925ca0be8/tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76", size = 243007, upload-time = "2026-01-11T11:21:49.456Z" }, + { url = "https://files.pythonhosted.org/packages/9c/6f/6e39ce66b58a5b7ae572a0f4352ff40c71e8573633deda43f6a379d56b3e/tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d", size = 240875, upload-time = "2026-01-11T11:21:50.755Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ad/cb089cb190487caa80204d503c7fd0f4d443f90b95cf4ef5cf5aa0f439b0/tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576", size = 246271, upload-time = "2026-01-11T11:21:51.81Z" }, + { url = "https://files.pythonhosted.org/packages/0b/63/69125220e47fd7a3a27fd0de0c6398c89432fec41bc739823bcc66506af6/tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a", size = 96770, upload-time = "2026-01-11T11:21:52.647Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0d/a22bb6c83f83386b0008425a6cd1fa1c14b5f3dd4bad05e98cf3dbbf4a64/tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa", size = 107626, upload-time = "2026-01-11T11:21:53.459Z" }, + { url = "https://files.pythonhosted.org/packages/2f/6d/77be674a3485e75cacbf2ddba2b146911477bd887dda9d8c9dfb2f15e871/tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614", size = 94842, upload-time = "2026-01-11T11:21:54.831Z" }, + { url = "https://files.pythonhosted.org/packages/3c/43/7389a1869f2f26dba52404e1ef13b4784b6b37dac93bac53457e3ff24ca3/tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1", size = 154894, upload-time = "2026-01-11T11:21:56.07Z" }, + { url = "https://files.pythonhosted.org/packages/e9/05/2f9bf110b5294132b2edf13fe6ca6ae456204f3d749f623307cbb7a946f2/tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8", size = 149053, upload-time = "2026-01-11T11:21:57.467Z" }, + { url = "https://files.pythonhosted.org/packages/e8/41/1eda3ca1abc6f6154a8db4d714a4d35c4ad90adc0bcf700657291593fbf3/tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a", size = 243481, upload-time = "2026-01-11T11:21:58.661Z" }, + { url = "https://files.pythonhosted.org/packages/d2/6d/02ff5ab6c8868b41e7d4b987ce2b5f6a51d3335a70aa144edd999e055a01/tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1", size = 251720, upload-time = "2026-01-11T11:22:00.178Z" }, + { url = "https://files.pythonhosted.org/packages/7b/57/0405c59a909c45d5b6f146107c6d997825aa87568b042042f7a9c0afed34/tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b", size = 247014, upload-time = "2026-01-11T11:22:01.238Z" }, + { url = "https://files.pythonhosted.org/packages/2c/0e/2e37568edd944b4165735687cbaf2fe3648129e440c26d02223672ee0630/tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51", size = 251820, upload-time = "2026-01-11T11:22:02.727Z" }, + { url = "https://files.pythonhosted.org/packages/5a/1c/ee3b707fdac82aeeb92d1a113f803cf6d0f37bdca0849cb489553e1f417a/tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729", size = 97712, upload-time = "2026-01-11T11:22:03.777Z" }, + { url = "https://files.pythonhosted.org/packages/69/13/c07a9177d0b3bab7913299b9278845fc6eaaca14a02667c6be0b0a2270c8/tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da", size = 108296, upload-time = "2026-01-11T11:22:04.86Z" }, + { url = "https://files.pythonhosted.org/packages/18/27/e267a60bbeeee343bcc279bb9e8fbed0cbe224bc7b2a3dc2975f22809a09/tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3", size = 94553, upload-time = "2026-01-11T11:22:05.854Z" }, + { url = "https://files.pythonhosted.org/packages/34/91/7f65f9809f2936e1f4ce6268ae1903074563603b2a2bd969ebbda802744f/tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0", size = 154915, upload-time = "2026-01-11T11:22:06.703Z" }, + { url = "https://files.pythonhosted.org/packages/20/aa/64dd73a5a849c2e8f216b755599c511badde80e91e9bc2271baa7b2cdbb1/tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e", size = 149038, upload-time = "2026-01-11T11:22:07.56Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8a/6d38870bd3d52c8d1505ce054469a73f73a0fe62c0eaf5dddf61447e32fa/tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4", size = 242245, upload-time = "2026-01-11T11:22:08.344Z" }, + { url = "https://files.pythonhosted.org/packages/59/bb/8002fadefb64ab2669e5b977df3f5e444febea60e717e755b38bb7c41029/tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e", size = 250335, upload-time = "2026-01-11T11:22:09.951Z" }, + { url = "https://files.pythonhosted.org/packages/a5/3d/4cdb6f791682b2ea916af2de96121b3cb1284d7c203d97d92d6003e91c8d/tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c", size = 245962, upload-time = "2026-01-11T11:22:11.27Z" }, + { url = "https://files.pythonhosted.org/packages/f2/4a/5f25789f9a460bd858ba9756ff52d0830d825b458e13f754952dd15fb7bb/tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f", size = 250396, upload-time = "2026-01-11T11:22:12.325Z" }, + { url = "https://files.pythonhosted.org/packages/aa/2f/b73a36fea58dfa08e8b3a268750e6853a6aac2a349241a905ebd86f3047a/tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86", size = 97530, upload-time = "2026-01-11T11:22:13.865Z" }, + { url = "https://files.pythonhosted.org/packages/3b/af/ca18c134b5d75de7e8dc551c5234eaba2e8e951f6b30139599b53de9c187/tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87", size = 108227, upload-time = "2026-01-11T11:22:15.224Z" }, + { url = "https://files.pythonhosted.org/packages/22/c3/b386b832f209fee8073c8138ec50f27b4460db2fdae9ffe022df89a57f9b/tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132", size = 94748, upload-time = "2026-01-11T11:22:16.009Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c4/84047a97eb1004418bc10bdbcfebda209fca6338002eba2dc27cc6d13563/tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6", size = 154725, upload-time = "2026-01-11T11:22:17.269Z" }, + { url = "https://files.pythonhosted.org/packages/a8/5d/d39038e646060b9d76274078cddf146ced86dc2b9e8bbf737ad5983609a0/tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc", size = 148901, upload-time = "2026-01-11T11:22:18.287Z" }, + { url = "https://files.pythonhosted.org/packages/73/e5/383be1724cb30f4ce44983d249645684a48c435e1cd4f8b5cded8a816d3c/tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66", size = 243375, upload-time = "2026-01-11T11:22:19.154Z" }, + { url = "https://files.pythonhosted.org/packages/31/f0/bea80c17971c8d16d3cc109dc3585b0f2ce1036b5f4a8a183789023574f2/tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d", size = 250639, upload-time = "2026-01-11T11:22:20.168Z" }, + { url = "https://files.pythonhosted.org/packages/2c/8f/2853c36abbb7608e3f945d8a74e32ed3a74ee3a1f468f1ffc7d1cb3abba6/tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702", size = 246897, upload-time = "2026-01-11T11:22:21.544Z" }, + { url = "https://files.pythonhosted.org/packages/49/f0/6c05e3196ed5337b9fe7ea003e95fd3819a840b7a0f2bf5a408ef1dad8ed/tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8", size = 254697, upload-time = "2026-01-11T11:22:23.058Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f5/2922ef29c9f2951883525def7429967fc4d8208494e5ab524234f06b688b/tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776", size = 98567, upload-time = "2026-01-11T11:22:24.033Z" }, + { url = "https://files.pythonhosted.org/packages/7b/31/22b52e2e06dd2a5fdbc3ee73226d763b184ff21fc24e20316a44ccc4d96b/tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475", size = 108556, upload-time = "2026-01-11T11:22:25.378Z" }, + { url = "https://files.pythonhosted.org/packages/48/3d/5058dff3255a3d01b705413f64f4306a141a8fd7a251e5a495e3f192a998/tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2", size = 96014, upload-time = "2026-01-11T11:22:26.138Z" }, + { url = "https://files.pythonhosted.org/packages/b8/4e/75dab8586e268424202d3a1997ef6014919c941b50642a1682df43204c22/tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9", size = 163339, upload-time = "2026-01-11T11:22:27.143Z" }, + { url = "https://files.pythonhosted.org/packages/06/e3/b904d9ab1016829a776d97f163f183a48be6a4deb87304d1e0116a349519/tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0", size = 159490, upload-time = "2026-01-11T11:22:28.399Z" }, + { url = "https://files.pythonhosted.org/packages/e3/5a/fc3622c8b1ad823e8ea98a35e3c632ee316d48f66f80f9708ceb4f2a0322/tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df", size = 269398, upload-time = "2026-01-11T11:22:29.345Z" }, + { url = "https://files.pythonhosted.org/packages/fd/33/62bd6152c8bdd4c305ad9faca48f51d3acb2df1f8791b1477d46ff86e7f8/tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d", size = 276515, upload-time = "2026-01-11T11:22:30.327Z" }, + { url = "https://files.pythonhosted.org/packages/4b/ff/ae53619499f5235ee4211e62a8d7982ba9e439a0fb4f2f351a93d67c1dd2/tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f", size = 273806, upload-time = "2026-01-11T11:22:32.56Z" }, + { url = "https://files.pythonhosted.org/packages/47/71/cbca7787fa68d4d0a9f7072821980b39fbb1b6faeb5f5cf02f4a5559fa28/tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b", size = 281340, upload-time = "2026-01-11T11:22:33.505Z" }, + { url = "https://files.pythonhosted.org/packages/f5/00/d595c120963ad42474cf6ee7771ad0d0e8a49d0f01e29576ee9195d9ecdf/tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087", size = 108106, upload-time = "2026-01-11T11:22:34.451Z" }, + { url = "https://files.pythonhosted.org/packages/de/69/9aa0c6a505c2f80e519b43764f8b4ba93b5a0bbd2d9a9de6e2b24271b9a5/tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd", size = 120504, upload-time = "2026-01-11T11:22:35.764Z" }, + { url = "https://files.pythonhosted.org/packages/b3/9f/f1668c281c58cfae01482f7114a4b88d345e4c140386241a1a24dcc9e7bc/tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4", size = 99561, upload-time = "2026-01-11T11:22:36.624Z" }, + { url = "https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a", size = 14477, upload-time = "2026-01-11T11:22:37.446Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +]