Skip to content

Commit 1d8f866

Browse files
committed
remove n=1 shortcut from simplify
1 parent 7524286 commit 1d8f866

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,9 +1168,6 @@ fn optimize_simplify(
11681168
use_ssa: Option<bool>,
11691169
) -> SSAPath {
11701170
let n = inputs.len();
1171-
if n <= 1 {
1172-
return vec![(0..n as u32).collect()];
1173-
}
11741171
let num_indices = size_dict.len();
11751172
let max_nodes = 2 * n;
11761173

tests/test_cotengrust.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ def test_single_input(which):
3939
inputs, output, size_dict, ntrials=1
4040
)
4141
assert flops == 0.0
42+
assert path == [[0]]
43+
elif which == "simplify":
44+
path = ctgr.optimize_simplify(inputs, output, size_dict)
45+
assert path == []
4246
else:
4347
path = {
44-
"simplify": ctgr.optimize_simplify,
4548
"greedy": ctgr.optimize_greedy,
4649
"optimal": ctgr.optimize_optimal,
4750
}[which](inputs, output, size_dict)
48-
assert path == [[0]]
51+
assert path == [[0]]
4952

5053

5154
@pytest.mark.parametrize("which", ["greedy", "optimal", "random_greedy"])

0 commit comments

Comments
 (0)