mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-05 04:17:53 +00:00
Add ability to generate multiple test dirs so that different input mixes can be tested. (#5310)
This commit is contained in:
parent
eae2473dc1
commit
1ff3b2d5b8
1 changed files with 11 additions and 3 deletions
|
|
@ -82,10 +82,18 @@ def create_test_dir(model_path, root_path, test_name,
|
|||
model_path = os.path.abspath(model_path)
|
||||
root_path = os.path.abspath(root_path)
|
||||
test_dir = os.path.join(root_path, test_name)
|
||||
test_data_dir = os.path.join(test_dir, "test_data_set_0")
|
||||
if not os.path.exists(test_dir):
|
||||
os.makedirs(test_dir)
|
||||
|
||||
if not os.path.exists(test_dir) or not os.path.exists(test_data_dir):
|
||||
os.makedirs(test_data_dir)
|
||||
# add to existing test data sets if present
|
||||
test_num = 0
|
||||
while True:
|
||||
test_data_dir = os.path.join(test_dir, "test_data_set_" + str(test_num))
|
||||
if not os.path.exists(test_data_dir):
|
||||
os.mkdir(test_data_dir)
|
||||
break
|
||||
|
||||
test_num += 1
|
||||
|
||||
model_filename = os.path.split(model_path)[-1]
|
||||
test_model_filename = os.path.join(test_dir, model_filename)
|
||||
|
|
|
|||
Loading…
Reference in a new issue