Posterior distributions in a confusion matrix

PyMC newbie here.
In a classification problem (k=3), I have a list of actual classes and classifier predictions. I would like to construct a confusion matrix of posterior probabilities where each cell represents the probability P(response | actual). My plan is to represent each cell as beta distribution. This is how I start

ground_truth =   [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]
classification = [0, 1, 2, 0, 1, 0, 2, 1, 2, 1, 0, 2]
with pm.Model() as model:
    confusion_matrix = pm.Beta('confusion probability', alpha=1,beta=1, shape=9)  # Nine values, one for each cell

However, I can’t see a way to continue this approach.

Following is one attempt that I tried but failed.

Since I have 12 observations in my example, I thought to create 12 Categorical distributions

with pm.Model() as model:
    confusion_matrix = pm.Beta('cm', alpha=1, beta=1, shape=9)
    probs = []
    for i, gt in enumerate(ground_truth):
        tmp = pm.Categorical(f'cat {i}', [confusion_matrix[gt*3+i] for i in range(3)])
        probs.append(tmp)
    classifications = pm.Deterministic('classifications', tt.tensor.stack(probs), observed=classification)
    trace = pm.sample(20, step=pm.Metropolis())

but this didn’t work with AttributeError: 'list' object has no attribute 'astype' error