I’m creating a simple HMM with gaussian emission. Modified from example from: Example: Hidden Markov Models — Pyro Tutorials 1.8.1 documentation

I got two issues:

- sample function always return [0, 1, 2] after first epoch.
- parameter p_mu merely change

```
def model(observations, num_state):
with poutine.mask(mask = True):
p_mu = pyro.sample("p_mu",
dist.Normal(0, 10000).expand([num_state]).to_event(1))
p_tau = pyro.sample("p_tau",
dist.Exponential(1).expand([num_state]).to_event(1))
p_transition = pyro.sample("p_transition",
dist.Dirichlet((1 / num_state) * torch.ones(num_state, num_state)).to_event(1))
current_state = 0
counter = 0
for t in pyro.markov(range(len(observations))):
counter += 1
current_state = pyro.sample("x_{}".format(t),
dist.Categorical(Vindex(p_transition)[current_state]),
infer = {"enumerate" : "parallel"})
print("counter: " + str(counter))
print(current_state)
pyro.sample("y_{}".format(t),
dist.Normal(Vindex(p_mu)[...,current_state], Vindex(p_tau)[...,current_state]),
obs = observations[t])
```

I use TraceTMC_ELBO

I have 200 observations, the value of current_state during first svi.step() is correct. p_transition is a 2d matrix

After the second time of svi.step(), the value of current_state is always [0, 1, 2].

```
counter: 198
tensor(0)
counter: 199
tensor(1)
counter: 200
tensor(0)
counter: 1
tensor([[0],
[1],
[2]])
counter: 2
tensor([[[0]],
[[1]],
[[2]]])
counter: 3
tensor([[0],
[1],
[2]])
counter: 4
tensor([[[0]],
[[1]],
[[2]]])
```