1919import numpy as np
2020import pymc as pm
2121import pytensor .tensor as pt
22- from pymc .logprob .transforms import RVTransform
22+ from pymc .logprob .transforms import Transform
2323
2424
2525class ParamCfg (TypedDict ):
2626 name : str
27- transform : Optional [RVTransform ]
27+ transform : Optional [Transform ]
2828 dims : Optional [Union [str , Tuple [str ]]]
2929
3030
@@ -44,14 +44,14 @@ class FlatInfo(TypedDict):
4444 info : List [VarInfo ]
4545
4646
47- def _arg_to_param_cfg (key , value : Optional [Union [ParamCfg , RVTransform , str , Tuple ]] = None ):
47+ def _arg_to_param_cfg (key , value : Optional [Union [ParamCfg , Transform , str , Tuple ]] = None ):
4848 if value is None :
4949 cfg = ParamCfg (name = key , transform = None , dims = None )
5050 elif isinstance (value , Tuple ):
5151 cfg = ParamCfg (name = key , transform = None , dims = value )
5252 elif isinstance (value , str ):
5353 cfg = ParamCfg (name = value , transform = None , dims = None )
54- elif isinstance (value , RVTransform ):
54+ elif isinstance (value , Transform ):
5555 cfg = ParamCfg (name = key , transform = value , dims = None )
5656 else :
5757 cfg = value .copy ()
@@ -62,7 +62,7 @@ def _arg_to_param_cfg(key, value: Optional[Union[ParamCfg, RVTransform, str, Tup
6262
6363
6464def _parse_args (
65- var_names : Sequence [str ], ** kwargs : Union [ParamCfg , RVTransform , str , Tuple ]
65+ var_names : Sequence [str ], ** kwargs : Union [ParamCfg , Transform , str , Tuple ]
6666) -> Dict [str , ParamCfg ]:
6767 results = dict ()
6868 for var in var_names :
@@ -133,7 +133,7 @@ def prior_from_idata(
133133 name = "trace_prior_" ,
134134 * ,
135135 var_names : Sequence [str ] = (),
136- ** kwargs : Union [ParamCfg , RVTransform , str , Tuple ]
136+ ** kwargs : Union [ParamCfg , Transform , str , Tuple ]
137137) -> Dict [str , pt .TensorVariable ]:
138138 """
139139 Create a prior from posterior using MvNormal approximation.
@@ -153,7 +153,7 @@ def prior_from_idata(
153153 Inference data with posterior group
154154 var_names: Sequence[str]
155155 names of variables to take as is from the posterior
156- kwargs: Union[ParamCfg, RVTransform , str, Tuple]
156+ kwargs: Union[ParamCfg, Transform , str, Tuple]
157157 names of variables with additional configuration, see more in Examples
158158
159159 Examples
0 commit comments