Skip to content

Commit 83e4bd2

Browse files
committed
Apply rule RUF046
1 parent 861816d commit 83e4bd2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pytensor/compile/profiling.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,22 +1298,22 @@ def print_stats(stats1, stats2):
12981298

12991299
print(
13001300
(
1301-
f" CPU: {int(round(new_max_running_max_memory_size[1] / 1024.0))}KB "
1302-
f"({int(round(max_running_max_memory_size[1] / 1024.0))}KB)"
1301+
f" CPU: {round(new_max_running_max_memory_size[1] / 1024.0)}KB "
1302+
f"({round(max_running_max_memory_size[1] / 1024.0)}KB)"
13031303
),
13041304
file=file,
13051305
)
13061306
print(
13071307
(
1308-
f" GPU: {int(round(new_max_running_max_memory_size[2] / 1024.0))}KB "
1309-
f"({int(round(max_running_max_memory_size[2] / 1024.0))}KB)"
1308+
f" GPU: {round(new_max_running_max_memory_size[2] / 1024.0)}KB "
1309+
f"({round(max_running_max_memory_size[2] / 1024.0)}KB)"
13101310
),
13111311
file=file,
13121312
)
13131313
print(
13141314
(
1315-
f" CPU + GPU: {int(round(new_max_running_max_memory_size[0] / 1024.0))}KB "
1316-
f"({int(round(max_running_max_memory_size[0] / 1024.0))}KB)"
1315+
f" CPU + GPU: {round(new_max_running_max_memory_size[0] / 1024.0)}KB "
1316+
f"({round(max_running_max_memory_size[0] / 1024.0)}KB)"
13171317
),
13181318
file=file,
13191319
)
@@ -1334,23 +1334,23 @@ def print_stats(stats1, stats2):
13341334
file=file,
13351335
)
13361336
print(
1337-
f" CPU: {int(round(new_max_node_memory_size[1] / 1024.0))}KB",
1337+
f" CPU: {round(new_max_node_memory_size[1] / 1024.0)}KB",
13381338
file=file,
13391339
)
13401340
print(
1341-
f" GPU: {int(round(new_max_node_memory_size[2] / 1024.0))}KB",
1341+
f" GPU: {round(new_max_node_memory_size[2] / 1024.0)}KB",
13421342
file=file,
13431343
)
13441344
print(
1345-
f" CPU + GPU: {int(round(new_max_node_memory_size[0] / 1024.0))}KB",
1345+
f" CPU + GPU: {round(new_max_node_memory_size[0] / 1024.0)}KB",
13461346
file=file,
13471347
)
13481348
print("---", file=file)
13491349

13501350
if min_max_peak:
13511351
print(
13521352
" Minimum peak from all valid apply node order is "
1353-
f"{int(round(min_max_peak / 1024.0))}KB(took {min_peak_time:3f}s to compute)",
1353+
f"{round(min_max_peak / 1024.0)}KB(took {min_peak_time:3f}s to compute)",
13541354
file=file,
13551355
)
13561356

tests/tensor/test_elemwise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class TestBroadcast:
255255
cop = Elemwise
256256

257257
openmp_minsize = 2 * config.openmp_elemwise_minsize
258-
openmp_minsize_sqrt = int(math.ceil(math.sqrt(openmp_minsize)))
258+
openmp_minsize_sqrt = math.ceil(math.sqrt(openmp_minsize))
259259

260260
# The order is important if you change them.
261261
linkers = [PerformLinker, CLinker]

0 commit comments

Comments
 (0)