File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1841,7 +1841,7 @@ def sample_posterior_predictive(
1841
1841
trace_coords : Dict [str , np .ndarray ] = {}
1842
1842
if "coords" not in idata_kwargs :
1843
1843
idata_kwargs ["coords" ] = {}
1844
- idata = None
1844
+ idata : Optional [ InferenceData ] = None
1845
1845
stacked_dims = None
1846
1846
if isinstance (trace , InferenceData ):
1847
1847
_constant_data = getattr (trace , "constant_data" , None )
@@ -1986,7 +1986,7 @@ def sample_posterior_predictive(
1986
1986
return pm .predictions_to_inference_data (ppc_trace , ** ikwargs )
1987
1987
idata_pp = pm .to_inference_data (posterior_predictive = ppc_trace , ** ikwargs )
1988
1988
1989
- if extend_inferencedata :
1989
+ if extend_inferencedata and idata is not None :
1990
1990
idata .extend (idata_pp )
1991
1991
return idata
1992
1992
return idata_pp
You can’t perform that action at this time.
0 commit comments