def dist(a, b):
    return sum((i-j)**2 for i, j in zip(a, b))
def sample_fn(x):
    return utils.optimise_and_sample(x, module=model,
                                     data=None, is_training=False)[0]