mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-23 19:32:23 +00:00
Cleanup build.py (#7245)
This commit is contained in:
parent
5bd192c439
commit
2fcd69d644
1 changed files with 1 additions and 29 deletions
|
|
@ -10,7 +10,6 @@ import re
|
|||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import hashlib
|
||||
import platform
|
||||
from amd_hipify import amd_hipify
|
||||
from distutils.version import LooseVersion
|
||||
|
|
@ -569,34 +568,7 @@ def install_python_deps(numpy_version=""):
|
|||
dep_packages.append('sympy>=1.1')
|
||||
dep_packages.append('packaging')
|
||||
dep_packages.append('cerberus')
|
||||
run_subprocess([sys.executable, '-m', 'pip', 'install', '--trusted-host',
|
||||
'files.pythonhosted.org'] + dep_packages)
|
||||
|
||||
|
||||
# We need to install Torch to test certain functionalities of the ORT Python package
|
||||
def install_torch():
|
||||
# Command works for both Windows
|
||||
run_subprocess([sys.executable, '-m', 'pip', 'install', '--trusted-host',
|
||||
'files.pythonhosted.org', 'torch===1.5.1+cu101', 'torchvision===0.6.1+cu101',
|
||||
'-f', 'https://download.pytorch.org/whl/torch_stable.html'])
|
||||
|
||||
|
||||
def check_md5(filename, expected_md5):
|
||||
if not os.path.exists(filename):
|
||||
return False
|
||||
hash_md5 = hashlib.md5()
|
||||
BLOCKSIZE = 1024 * 64
|
||||
with open(filename, "rb") as f:
|
||||
buf = f.read(BLOCKSIZE)
|
||||
while len(buf) > 0:
|
||||
hash_md5.update(buf)
|
||||
buf = f.read(BLOCKSIZE)
|
||||
hex = hash_md5.hexdigest()
|
||||
if hex != expected_md5:
|
||||
log.info('md5 mismatch, expect %s, got %s' % (expected_md5, hex))
|
||||
os.remove(filename)
|
||||
return False
|
||||
return True
|
||||
run_subprocess([sys.executable, '-m', 'pip', 'install'] + dep_packages)
|
||||
|
||||
|
||||
def setup_test_data(build_dir, configs):
|
||||
|
|
|
|||
Loading…
Reference in a new issue