Shape confusion in discrete mixture

In the pm.Mixture class, what is the correct relationship between the shapes of the weights and the component distributions? more specifically if

K = pm.Mixture('K',w=W, comp_dists=L)

how should the shapes of W and L be related?

Here is what I am trying (but it doesn’t work):

with pm.Model() as jtt:
    mu = pm.Beta('mu',alpha=np.array([1,1,1]),beta=np.array([1,1,1]),shape=(2,3))
    w = pm.Dirichlet('w',np.ones(shape=(2,)))
    components = pm.Bernoulli.dist(p=mu,shape=(2,3))
    K = pm.Mixture('K', w=w, comp_dists = components,shape=3,testval=.5)
    trace = pm.sample()

The goal is to model a mixture of 2 classes of variables, each of which is a vector of three Bernoulli’s, with Beta priors on the bernoullis and a Dirichlet prior on the classes. I get this error:

ValueError: Input dimension mis-match. (input[0].shape[0] = 3, input[1].shape[0] = 2)

which I find uninformative since I don’t know what in means by input[0] and input[1]. And I’ve permuted things around. Help much appreciated.