@@ -107,18 +107,10 @@ def __new__(cls, name, bases, dct, **kwargs):
107
107
108
108
def __enter__ (self ):
109
109
self .__class__ .context_class .get_contexts ().append (self )
110
- # self._pytensor_config is set in Model.__new__
111
- self ._config_context = None
112
- if hasattr (self , "_pytensor_config" ):
113
- self ._config_context = pytensor .config .change_flags (** self ._pytensor_config )
114
- self ._config_context .__enter__ ()
115
110
return self
116
111
117
112
def __exit__ (self , typ , value , traceback ):
118
113
self .__class__ .context_class .get_contexts ().pop ()
119
- # self._pytensor_config is set in Model.__new__
120
- if self ._config_context :
121
- self ._config_context .__exit__ (typ , value , traceback )
122
114
123
115
dct [__enter__ .__name__ ] = __enter__
124
116
dct [__exit__ .__name__ ] = __exit__
@@ -485,13 +477,6 @@ def __new__(cls, *args, **kwargs):
485
477
instance ._parent = kwargs .get ("model" )
486
478
else :
487
479
instance ._parent = cls .get_context (error_if_none = False )
488
- pytensor_config = kwargs .get ("pytensor_config" , {})
489
- if pytensor_config :
490
- warnings .warn (
491
- "pytensor_config is deprecated. Use pytensor.config or pytensor.config.change_flags context manager instead." ,
492
- FutureWarning ,
493
- )
494
- instance ._pytensor_config = pytensor_config
495
480
return instance
496
481
497
482
@staticmethod
@@ -507,10 +492,9 @@ def __init__(
507
492
check_bounds = True ,
508
493
* ,
509
494
coords_mutable = None ,
510
- pytensor_config = None ,
511
495
model = None ,
512
496
):
513
- del pytensor_config , model # used in __new__
497
+ del model # used in __new__
514
498
self .name = self ._validate_name (name )
515
499
self .check_bounds = check_bounds
516
500
@@ -560,11 +544,6 @@ def __init__(
560
544
functools .partial (str_for_model , formatting = "latex" ), self
561
545
)
562
546
563
- @property
564
- def model (self ):
565
- warnings .warn ("Model.model property is deprecated. Just use Model." , FutureWarning )
566
- return self
567
-
568
547
@property
569
548
def parent (self ):
570
549
return self ._parent
@@ -671,7 +650,7 @@ def compile_d2logp(
671
650
jacobian : bool
672
651
Whether to include jacobian terms in logprob graph. Defaults to True.
673
652
"""
674
- return self .model . compile_fn (
653
+ return self .compile_fn (
675
654
self .d2logp (vars = vars , jacobian = jacobian , negate_output = negate_output ),
676
655
** compile_kwargs ,
677
656
)
0 commit comments