Hi all,
I ran the following code and got a UserWarning.
Is there a solution to avoid this User Warning?
import numpy as np
import pymc as pm
import pytensor
from pymc.pytensorf import collect_default_updates
with pm.Model() as model:
t = pm.Beta("t", alpha=2, beta=1, shape=3)
def loop(symbol, t):
symbol_new = pm.Categorical.dist(t)
return (symbol_new), collect_default_updates([symbol_new])
symbol = np.array(0, dtype=int)
results, updates = pytensor.scan(
fn=loop,
outputs_info=[symbol],
non_sequences=[t],
n_steps=10,
strict=True
)
pm.Deterministic("final_symbol", results[-1])
idata = pm.sample_prior_predictive(10)
UserWarning: RNG Variable RandomGeneratorSharedVariable(<Generator(PCG64) at 0x14F69B300>) has multiple clients. This is likely an inconsistent random graph.
warnings.warn(
Sampling: [t]