Skip to content

Commit d9aaa1a

Browse files
committed
purge qkeras workaround
1 parent c11dddb commit d9aaa1a

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

hls4ml/__init__.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,3 @@
1-
# Temporary workaround for QKeras installation requirement, will be removed after 1.0.0
2-
def maybe_install_qkeras():
3-
import subprocess
4-
import sys
5-
6-
QKERAS_PKG_NAME = 'QKeras'
7-
# QKERAS_PKG_SOURCE = QKERAS_PKG_NAME
8-
QKERAS_PKG_SOURCE = 'qkeras@git+https://github.com/fastmachinelearning/qkeras.git'
9-
10-
def pip_list():
11-
p = subprocess.run([sys.executable, '-m', 'pip', 'list'], check=True, capture_output=True)
12-
return p.stdout.decode()
13-
14-
def pip_install(package):
15-
subprocess.check_call([sys.executable, '-m', 'pip', 'install', package])
16-
17-
all_pkgs = pip_list()
18-
if QKERAS_PKG_NAME not in all_pkgs:
19-
print('QKeras installation not found, installing one...')
20-
pip_install(QKERAS_PKG_SOURCE)
21-
print('QKeras installed.')
22-
23-
24-
try:
25-
maybe_install_qkeras()
26-
except Exception:
27-
print('Could not find QKeras installation, make sure you have QKeras installed.')
28-
29-
# End of workaround
30-
311
from hls4ml import converters, report, utils # noqa: F401, E402
322

333
try:

0 commit comments

Comments
 (0)