From f89d3c891679a1440c61145e0ec9206be90272ca Mon Sep 17 00:00:00 2001
From: Wen Jufa
Date: Tue, 14 Feb 2023 12:17:23 +0800
Subject: [PATCH] Add outdir arg
Change-Id: Ibc76668929262abc59afe5b601acf0dff7203bf2
---
python/tpu_perf/buildtree.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/python/tpu_perf/buildtree.py b/python/tpu_perf/buildtree.py
index 22a7470..b586bab 100644
--- a/python/tpu_perf/buildtree.py
+++ b/python/tpu_perf/buildtree.py
@@ -40,8 +40,10 @@ def __init__(self, root, args = None):
self.root = root
self.global_config = global_config = read_config(root) or dict()
global_config['root'] = root
- if 'outdir' not in global_config:
- global_config['outdir'] = os.path.join(root, 'output')
+ outdir = 'output'
+ if args.outdir:
+ outdir = args.outdir
+ global_config['outdir'] = os.path.join(root, outdir)
self.cases = []
if not args.full:
@@ -73,6 +75,7 @@ def add_arguments(parser):
'models', metavar='MODEL', type=str, nargs='*',
help='model directories to run')
parser.add_argument('--full', action='store_true', help='Run all cases')
+ parser.add_argument('--outdir', '-o', type=str, help='Output path')
parser.add_argument('--list', '-l', type=str, help='Case list')
parser.add_argument('--devices', '-d',
type=int, nargs='*', help='Devices',