Fix repo_dir cannot export/write mlir file bug (#157)

-Set repro_dir as a temporary dir within current working directory.
This commit is contained in:
Chi_Liu
2022-06-23 18:37:16 -07:00
committed by GitHub
parent b7b2dfaa8d
commit fa0aaf63c2
3 changed files with 9 additions and 2 deletions

1
.gitignore vendored
View File

@@ -162,6 +162,7 @@ cython_debug/
# Shark related artefacts
*venv/
shark_tmp/
# ORT related artefacts
cache_models/

View File

@@ -44,8 +44,7 @@ parser.add_argument(
parser.add_argument(
"--repro_dir",
help="Directory to which module files will be saved for reproduction or debugging.",
type=dir_path,
default="./repro_dir/",
default="./shark_tmp/",
)
parser.add_argument(
"--save_mlir",
@@ -79,3 +78,7 @@ parser.add_argument(
)
shark_args, unknown = parser.parse_known_args()
if not os.path.exists(shark_args.repro_dir):
# Create a new directory because it does not exist
os.makedirs(shark_args.repro_dir)

View File

@@ -89,5 +89,8 @@ class AlbertTfliteModuleTest(unittest.TestCase):
if __name__ == "__main__":
# module_tester = AlbertTfliteModuleTester()
# module_tester.save_mlir = True
# module_tester.save_vmfb = True
# module_tester.create_and_check_module()
unittest.main()