Skip to content

Commit

Permalink
[BE][Ez]: Use NotADirectoryError in tensorboard writer (#126534)
Browse files Browse the repository at this point in the history
Slightly improve exception typing for tensorboard wrriter
Pull Request resolved: #126534
Approved by: https://github.com/ezyang
  • Loading branch information
Skylion007 authored and ZelboK committed May 19, 2024
1 parent 782792b commit 5182e2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/utils/tensorboard/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def add_embedding(
"warning: Embedding dir exists, did you set global_step for add_embedding()?"
)
else:
raise FileExistsError(
raise NotADirectoryError(
f"Path: `{save_path}` exists, but is a file. Cannot proceed."
)
else:
Expand Down

0 comments on commit 5182e2e

Please sign in to comment.