def label_func(s, label=label):
                self.set_label(s, label)
def sample_fn(x):
    return utils.optimise_and_sample(x, module=model,
                                     data=None, is_training=False)[0]