set_data does not always work when the input change shape, especially if the shape is specified or hard coded in the model. The best way in this case is to reinitialized the same model but conditioned on the test input, for example, a good practice is to have:
def generate_model(x, y):
with pm.Model() as m:
...
return m
and then call it as:
train_model = generate_model(train_x, train_y)
with train_model:
trace = pm.sample(...)
for posterior predictive conditioned on the test set, you can then do:
test_model = generate_model(test_x, test_y)
with test_model:
ppc = pm.sample_posterior_predictive(trace, ...)