Skip to content

Commit 335ca1e

Browse files
ArmavicaricardoV94
authored andcommitted
Fix RUF007 (itertools.pairwise)
1 parent 79ff97a commit 335ca1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pytensor/tensor/rewriting/subtensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import itertools
12
import sys
23
from collections.abc import Iterable
34

@@ -1700,7 +1701,7 @@ def local_join_subtensors(fgraph, node):
17001701
return
17011702

17021703
for subtensor1_idx, (subtensor1, subtensor2) in enumerate(
1703-
zip(tensors[:-1], tensors[1:])
1704+
itertools.pairwise(tensors)
17041705
):
17051706
# Check that two consecutive Subtensors are operating on the same base tensor
17061707
if not (

0 commit comments

Comments
 (0)