@@ -87,10 +87,6 @@ def __set__(self, value: Any) -> None:
8787 if self .readonly :
8888 raise Exception (f"Cannot set readonly storage: { self .name } " )
8989 try :
90- if value is None :
91- self .storage [0 ] = None
92- return
93-
9490 kwargs = {}
9591 if self .strict :
9692 kwargs ["strict" ] = True
@@ -539,14 +535,12 @@ def make_thunk(self, **kwargs):
539535
540536 def f ():
541537 for inputs in input_lists [1 :]:
542- # strict=False because we are in a hot loop
543- for input1 , input2 in zip (inputs0 , inputs , strict = False ):
538+ for input1 , input2 in zip (inputs0 , inputs , strict = True ):
544539 input2 .storage [0 ] = copy (input1 .storage [0 ])
545540 for x in to_reset :
546541 x [0 ] = None
547542 pre (self , [input .data for input in input_lists [0 ]], order , thunk_groups )
548- # strict=False because we are in a hot loop
549- for i , (thunks , node ) in enumerate (zip (thunk_groups , order , strict = False )):
543+ for i , (thunks , node ) in enumerate (zip (thunk_groups , order , strict = True )):
550544 try :
551545 wrapper (self .fgraph , i , node , * thunks )
552546 except Exception :
@@ -668,10 +662,12 @@ def thunk(
668662 # since the error may come from any of them?
669663 raise_with_op (self .fgraph , output_nodes [0 ], thunk )
670664
671- # strict=False because we are in a hot loop
672- for o_storage , o_val in zip (thunk_outputs , outputs , strict = False ):
665+ # strict=None because we are in a hot loop
666+ for o_storage , o_val in zip (thunk_outputs , outputs ): # noqa: B905
673667 o_storage [0 ] = o_val
674668
669+ return outputs
670+
675671 thunk .inputs = thunk_inputs
676672 thunk .outputs = thunk_outputs
677673 thunk .lazy = False
0 commit comments