Skip to content

Commit 43b775f

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 2aecb95 commit 43b775f

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
@@ -878,6 +878,8 @@ def __call__(self, *args, output_subset=None, **kwargs):
878878
output_subset = [self.output_keys.index(key) for key in output_subset]
879879

880880
# Reinitialize each container's 'provided' counter
881+
if len(args) == 0: # for speed we trust the input for empty args
882+
trust_input = True
881883
if trust_input:
882884
for arg_container, arg in zip(input_storage, args, strict=False):
883885
arg_container.storage[0] = arg

0 commit comments

Comments
 (0)