IMHO one of Pyro’s greatest features is the correspondence between the graphical model representation and the code. To implement the guide for the model below (right):

it made sense to me to write the following code:

```
def guide(data, vocab_size, num_topics):
# not shown in the graphical model
with pyro.plate("topics", num_topics):
lambda_ = pyro.param("lambda", data.new_ones(vocab_size))
beta = pyro.sample("beta", dist.Dirichlet(lambda_))
# shown in the graphical model
with pyro.plate("documents", data.shape[1]):
gamma = pyro.param("gamma", data.new_ones(num_topics))
theta = pyro.sample("theta", dist.Dirichlet(gamma))
with pyro.plate("words", data.shape[0]):
phi = pyro.param("phi", data.new_ones((data.shape[1], num_topics)) / num_topics)
zeta = pyro.sample("zeta", dist.Categorical(phi))
```

where `data`

is a tensor with dimensions `words_per_doc`

x `batch_size`

.

Let’s look at the first plate. My expectation was that `with pyro.plate`

would build a `lambda_`

table with dimensions `num_topics`

x `vocab_size`

, exactly as it did with `beta`

. However, that was not the case: `beta`

has `num_topics`

x `vocab_size`

(as I expected), but `lambda_`

is a simple vector with `vocab_size`

dimensions. Same problem happens with `gamma`

and `phi`

.

**Question: Am I doing something wrong or that’s the expected behavior? If the latter is true, wouldn’t be more intuitive to have pyro.param and pyro.sample behaving the same way?**

Thanks!