Skip to content

Commit ca5f42c

Browse files
committed
Make sure intermediate_path exists before adding file_handler
Signed-off-by: Erik Lundell <erik.lundell@arm.com> Change-Id: I89a6329ae3bcc4e1316f451c71b37d934c3bf4f4
1 parent c6c2f37 commit ca5f42c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

backends/arm/tosa/partitioner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,10 @@ def partition(self, exported_program: ExportedProgram) -> PartitionResult:
433433

434434
tag_constant_data(exported_program)
435435
if self.intermediate_path is not None and logger.level <= logging.INFO:
436+
intermediate_path = Path(self.intermediate_path)
437+
intermediate_path.mkdir(parents=True, exist_ok=True)
436438
file_handler = logging.FileHandler(
437-
Path(self.intermediate_path) / "partition_report.txt"
439+
intermediate_path / "partition_report.txt"
438440
)
439441
logger.addHandler(file_handler)
440442
logger.info(f"The following nodes were rejected for {self.tosa_spec}:")

0 commit comments

Comments
 (0)