File tree Expand file tree Collapse file tree 2 files changed +2
-24
lines changed Expand file tree Collapse file tree 2 files changed +2
-24
lines changed Original file line number Diff line number Diff line change 23
23
24
24
import aesara
25
25
import aesara .tensor as at
26
- import dill
27
26
28
27
from aesara .tensor .random .op import RandomVariable
29
28
from aesara .tensor .random .var import RandomStateSharedVariable
@@ -533,26 +532,5 @@ def __init__(
533
532
self .wrap_random_with_dist_shape = wrap_random_with_dist_shape
534
533
self .check_shape_in_random = check_shape_in_random
535
534
536
- def __getstate__ (self ):
537
- # We use dill to serialize the logp function, as this is almost
538
- # always defined in the notebook and won't be pickled correctly.
539
- # Fix https://github.com/pymc-devs/pymc3/issues/3844
540
- try :
541
- logp = dill .dumps (self .logp )
542
- except RecursionError as err :
543
- if type (self .logp ) == types .MethodType :
544
- raise ValueError (
545
- "logp for DensityDist is a bound method, leading to RecursionError while serializing"
546
- ) from err
547
- else :
548
- raise err
549
- vals = self .__dict__ .copy ()
550
- vals ["logp" ] = logp
551
- return vals
552
-
553
- def __setstate__ (self , vals ):
554
- vals ["logp" ] = dill .loads (vals ["logp" ])
555
- self .__dict__ = vals
556
-
557
535
def _distr_parameters_for_repr (self ):
558
536
return []
Original file line number Diff line number Diff line change 19
19
from typing import Dict , List , Tuple , Union
20
20
21
21
import arviz
22
- import dill
22
+ import cloudpickle
23
23
import numpy as np
24
24
import xarray
25
25
@@ -347,7 +347,7 @@ def hashable(a=None) -> int:
347
347
pass
348
348
# Not hashable >>>
349
349
try :
350
- return hash (dill .dumps (a ))
350
+ return hash (cloudpickle .dumps (a ))
351
351
except Exception :
352
352
if hasattr (a , "__dict__" ):
353
353
return hashable (a .__dict__ )
You can’t perform that action at this time.
0 commit comments