def __init__(self, filename=None):
        self.filename = None
        if filename:
            self.load(filename)
def sample_fn(x):
    return utils.optimise_and_sample(x, module=model,
                                     data=None, is_training=False)[0]