There is no need to compile the operation into a theano.function, apply the ops on the tensor directly like:
with pm.Model() as model:
gamma = pm.DiscreteUniform('gamma',lower=413,upper=1000)
delta = pm.DiscreteUniform('delta',lower=1,upper=gamma, shape=(900))
st = theano.tensor.extra_ops.Unique(False, False, True)(delta)
...