Number of samples generated by `sample_posterior_predictive`

Hi all,

I have one doubt regarding 'sample_posterior_predictive function. Actually I wish to compute the weights(probability) of predicted samples. So I used the function
“pymc3.sampling.sample_posterior_predictive_w(trace)”.
But when I’m trying to run this ,an error occured.Its like

AttributeError Traceback (most recent call last)
in
----> 1 ppc_w = pm.sample_posterior_predictive_w(trace, 1000, model_particle,progressbar=False)

~/.local/lib/python3.6/site-packages/pymc3/sampling.py in sample_posterior_predictive_w(traces, samples, models, weights, random_seed, progressbar)
1786 traces = [dataset_to_point_dict(trace) for trace in traces]
1787 else:
-> 1788 n_samples = [len(i) * i.nchains for i in traces]
1789
1790 if models is None:

~/.local/lib/python3.6/site-packages/pymc3/sampling.py in (.0)
1786 traces = [dataset_to_point_dict(trace) for trace in traces]
1787 else:
-> 1788 n_samples = [len(i) * i.nchains for i in traces]
1789
1790 if models is None:

AttributeError: ‘dict’ object has no attribute ‘nchains’

Can anybody help me to resolve this error.Thanks in advance