Skip to content

Commit

Permalink
use_existing_torch.py: filter out comments
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Parnell <[email protected]>
  • Loading branch information
tdoublep committed Jan 21, 2025
1 parent f2e9f2a commit 3105f0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions use_existing_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
print(f">>> cleaning {file}")
with open(file) as f:
lines = f.readlines()
# filter out comments
lines = [ line.split(" #")[0] for line in lines ]
if "torch" in "".join(lines).lower():
print("removed:")
with open(file, 'w') as f:
Expand Down

0 comments on commit 3105f0c

Please sign in to comment.