You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by co...@apache.org on 2021/03/15 17:09:26 UTC
[tvm] branch main updated: [TVMC] Fix to check whether a path
passed to --target is strictly a file (#7663)
This is an automated email from the ASF dual-hosted git repository.
comaniac pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 5bd78b3 [TVMC] Fix to check whether a path passed to --target is strictly a file (#7663)
5bd78b3 is described below
commit 5bd78b398f3658bc66bec66aea78e6aa5faf872f
Author: Leandro Nunes <le...@arm.com>
AuthorDate: Mon Mar 15 17:09:05 2021 +0000
[TVMC] Fix to check whether a path passed to --target is strictly a file (#7663)
* When we use file with --target, the validation in place was only
checking whether it was a valid path. For the case in which the
path is a directory, it causes a crash when tvmc then tries to
open the path.
* This fix moved the check to be strictly for files, not only a valid
path
---
python/tvm/driver/tvmc/common.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/tvm/driver/tvmc/common.py b/python/tvm/driver/tvmc/common.py
index fbd7bc8..864c3a9 100644
--- a/python/tvm/driver/tvmc/common.py
+++ b/python/tvm/driver/tvmc/common.py
@@ -280,7 +280,7 @@ def target_from_cli(target):
"""
extra_targets = []
- if os.path.exists(target):
+ if os.path.isfile(target):
with open(target) as target_file:
logger.debug("target input is a path: %s", target)
target = "".join(target_file.readlines())