@@ -219,19 +219,16 @@ def connection_pattern(self, node=None):
219219 not differentiable, so it is never connected. The optimized variable is connected only to inputs that are
220220 both connected to the objective function and of float dtype.
221221 """
222- if self ._connection_pattern is not None :
223- return self ._connection_pattern
224-
225222 fx = self .fgraph .outputs [0 ]
226223 inputs = self .fgraph .inputs
227224
228- connections = [
229- [connection and input .type .dtype in ("float32" , "float64" ), False ]
225+ return [
226+ [
227+ (connection and input .type .dtype in ("float32" , "float64" ),),
228+ False ,
229+ ]
230230 for input , connection in zip (inputs , io_connection_pattern (inputs , [fx ]))
231231 ]
232- self ._connection_pattern = connections
233-
234- return connections
235232
236233
237234class ScipyScalarWrapperOp (ScipyWrapperOp ):
@@ -496,7 +493,6 @@ def __init__(
496493 self .optimizer_kwargs = optimizer_kwargs if optimizer_kwargs is not None else {}
497494 self ._fn = None
498495 self ._fn_wrapped = None
499- self ._connection_pattern = None
500496
501497 def __str__ (self ):
502498 return f"{ self .__class__ .__name__ } (method={ self .method } )"
@@ -633,7 +629,6 @@ def __init__(
633629 self .optimizer_kwargs = optimizer_kwargs if optimizer_kwargs is not None else {}
634630 self ._fn = None
635631 self ._fn_wrapped = None
636- self ._connection_pattern = None
637632
638633 def __str__ (self ):
639634 str_args = ", " .join (
@@ -831,7 +826,6 @@ def __init__(
831826
832827 self ._fn = None
833828 self ._fn_wrapped = None
834- self ._connection_pattern = None
835829
836830 def __str__ (self ):
837831 str_args = ", " .join (
@@ -978,7 +972,6 @@ def __init__(
978972 self .optimizer_kwargs = optimizer_kwargs if optimizer_kwargs is not None else {}
979973 self ._fn = None
980974 self ._fn_wrapped = None
981- self ._connection_pattern = None
982975
983976 def __str__ (self ):
984977 str_args = ", " .join (
0 commit comments