Potential with array of logps

What are you trying to do? If you want to add the logp term directly to the graph, you should use Potential. Whether you sum it or not is irrelevant, Potential will call sum on your output regardless.

But Potential does not return anything (useful), it simply adds a logp term to the model. Why would you need it to return something? What are you planning to do downstream of it?

Edit: It looks like there is something wrong with you Op. Can you share the whole code, including the part that leads to an error message?

Maybe these v4 guides can help?