Tensor shape question (technical — using pyro.plates and to_event)

We have a variable y that’s three dimensional, PxRxC (precincts, races, candidates). In the model, P is a plate, R is to_event, and C is multinomial, meaning that pyro thinks of it as a PxR array of C vectors:

with pyro.plate('precincts',P):
    y = pyro.sample('y', dist.Multinomial(N,logits=logits).to_event(1))

In the guide, I’m doing some auxiliary sampling to figure out what y’s value should be, so when I get to actually sampling y itself, I’m using a delta distribution:

pyro.sample("y", dist.Delta(y).to_event(2) ) #Doesn't work

Unfortunately, to_event grabs two dimensions on the right, when what I want it to do is skip the rightmost (multinomial) dimension and grab the next two.

What can I do?

I got so desperate, I tried to rewrite dist.Delta. I fought my way past at least 5 different errors, only to be finally defeated by the dark magic of guide_site["fn"].event_dim.