Skip to content

Commit

Permalink
Update hook-torch.py using separated collections
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlGao4 committed Dec 3, 2023
1 parent a91471f commit f3b19f7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.utils.hooks import logger, collect_data_files, is_module_satisfies, collect_dynamic_libs
from PyInstaller.compat import ALL_SUFFIXES
from PyInstaller.utils.hooks import logger, collect_data_files, is_module_satisfies, collect_dynamic_libs, collect_submodules

datas = collect_data_files("torch", excludes=["**/*.h", "**/*.hpp", "**/*.cuh", "**/*.lib"])
datas += collect_dynamic_libs("torch", search_patterns=["**/*" + i for i in ALL_SUFFIXES if i.lower() != ".pyc"])
module_collection_mode = 'pyz+py'

datas = collect_data_files("torch", excludes=["**/*.h", "**/*.hpp", "**/*.cuh",
"**/*.lib", "**/*.cpp", "**/*.pyi", "**/*.cmake"])
binaries = collect_dynamic_libs("torch")
hiddenimports = collect_submodules("torch")

# With torch 2.0.0, PyInstaller's modulegraph analysis hits the recursion limit.
# So, unless the user has already done so, increase it automatically.
Expand Down

0 comments on commit f3b19f7

Please sign in to comment.