Skip to content

Commit 2d731c4

Browse files
committed
fix: E226 missing whitespace around arithmetic operator
1 parent 76e5474 commit 2d731c4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

torchsparsegradutils/benchmarks/benchmark_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ def format_time(t_us):
296296
if np.isnan(t_us):
297297
return "N/A"
298298
if t_us >= 1e6: # >= 1 second
299-
return f"{t_us/1e6:.3f}s"
299+
return f"{t_us / 1e6:.3f}s"
300300
elif t_us >= 1e3: # >= 1 millisecond
301-
return f"{t_us/1e3:.1f}ms"
301+
return f"{t_us / 1e3:.1f}ms"
302302
else:
303303
return f"{t_us:.1f}μs"
304304

@@ -308,7 +308,7 @@ def format_memory(mem_mb):
308308
if np.isnan(mem_mb):
309309
return "N/A"
310310
if mem_mb >= 1024:
311-
return f"{mem_mb/1024:.1f}GB"
311+
return f"{mem_mb / 1024:.1f}GB"
312312
else:
313313
return f"{mem_mb:.1f}MB"
314314

@@ -350,7 +350,7 @@ def print_results_table_header():
350350
print(
351351
f" {'Algorithm':<25} {'Shape':<15} {'Fwd Time±Std':<15} {'Fwd Mem±Std':<15} {'Bwd Time±Std':<15} {'Bwd Mem±Std':<15}"
352352
)
353-
print(f" {'-'*25} {'-'*15} {'-'*15} {'-'*15} {'-'*15} {'-'*15}")
353+
print(f" {'-' * 25} {'-' * 15} {'-' * 15} {'-' * 15} {'-' * 15} {'-' * 15}")
354354

355355

356356
def save_benchmark_results(records, benchmark_name):

torchsparsegradutils/benchmarks/visualize_benchmark_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def create_summary_report(self):
787787
algorithms = df[algo_col].value_counts()
788788
print(f" - Algorithms tested: {', '.join(algorithms.index[:5])}")
789789
if len(algorithms) > 5:
790-
print(f" (and {len(algorithms)-5} more)")
790+
print(f" (and {len(algorithms) - 5} more)")
791791

792792
print(f"\nVisualization files saved to: {self.output_dir}")
793793
print("Generated plots:")

0 commit comments

Comments
 (0)