Skip to content

Commit 5d914f6

Browse files
committed
use_existing_torch.py: filter out comments
Signed-off-by: Thomas Parnell <[email protected]>
1 parent 9d534a7 commit 5d914f6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

use_existing_torch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
print(f">>> cleaning {file}")
77
with open(file) as f:
88
lines = f.readlines()
9+
# filter out comments
10+
lines = [ line.split(" #")[0] for line in lines ]
911
if "torch" in "".join(lines).lower():
1012
print("removed:")
1113
with open(file, 'w') as f:

0 commit comments

Comments
 (0)