Skip to content

Commit f7ea8df

Browse files
committed
remove deprecation exception from scan argumens and replace it with an informative ValueError
1 parent ebc22b7 commit f7ea8df

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pytensor/scan/basic.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -502,16 +502,6 @@ def wrap_into_list(x):
502502
# wrap outputs info in a dictionary if they are not already in one
503503
for i in range(n_outs):
504504
if outs_info[i] is not None:
505-
if isinstance(outs_info[i], dict):
506-
if outs_info[i].get("return_steps", None) is not None:
507-
raise DeprecationWarning(
508-
"Using `return_steps` has been deprecated. "
509-
"Simply select the entries you need using a "
510-
"subtensor. Scan will optimize memory "
511-
"consumption, so do not worry about that."
512-
)
513-
# END
514-
515505
if not isinstance(outs_info[i], dict):
516506
# by default any output has a tap value of -1
517507
outs_info[i] = dict([("initial", outs_info[i]), ("taps", [-1])])
@@ -551,6 +541,11 @@ def wrap_into_list(x):
551541
("All the tap values must be smaller than 0."),
552542
outs_info[i],
553543
)
544+
_unexpected_keys = set(outs_info[i]) - {"initial", "taps", "inplace"}
545+
if _unexpected_keys:
546+
raise ValueError(
547+
f"These keys were unexpected in Scan outputs_info[{i}]: {_unexpected_keys}"
548+
)
554549
else:
555550
# if a None is provided as the output info we replace it
556551
# with an empty OrdereDict() to simplify handling

0 commit comments

Comments
 (0)