Using sampling to decide network architecture

I want to set up priors on the shape of network architecture of a simple ann and run it on the mnist dataset. This is just a toy example to test a hypothesis.

So i would need to set up a random variable No_of_variables with prior as Poisson(mu=2), how do I use this to make a custom neural network?

I have a function which takes in input a list network, the length of this list is the number of hidden layers and each integer at index is the number of neurons in hidden layers. I want to set up priors over both of these and see what happens

I dont think you can do this in PyMC3, as currently it does not accept tensor as shape argument in the definition of random variables. As a workaround, you can set a maximum number of layers and neurons as the shape of the random variable, and setting some of the coefficient / weight to zeros according to some distributions.