Skip to content

Commit fd69bed

Browse files
Optimize order of input checks in OpFromGraph
1 parent 6c3e420 commit fd69bed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytensor/compile/builders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def __init__(
401401
inline.
402402
"""
403403
ignore_unused_inputs = kwargs.get("on_unused_input", False) == "ignore"
404-
if len(inputs) != len(set(inputs)) and not ignore_unused_inputs:
404+
if not ignore_unused_inputs and len(inputs) != len(set(inputs)):
405405
var_counts = {var: inputs.count(var) for var in inputs}
406406
duplicated_inputs = [var for var, count in var_counts.items() if count > 1]
407407
raise ValueError(

0 commit comments

Comments
 (0)