Skip to content

Commit 73adcba

Browse files
committed
Added an if condition to set trust_input to True if argument list is empty in __call__ function of Function class in pytensor/compile/function/types.py
1 parent 1b8a27c commit 73adcba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pytensor/compile/function/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@ def __call__(self, *args, output_subset=None, **kwargs):
883883
output_subset = [self.output_keys.index(key) for key in output_subset]
884884

885885
# Reinitialize each container's 'provided' counter
886+
if len(args) == 0: # for speed we trust the input for empty args
887+
trust_input = True
886888
if trust_input:
887889
for arg_container, arg in zip(input_storage, args, strict=False):
888890
arg_container.storage[0] = arg

0 commit comments

Comments
 (0)