def load_learner(fname, cpu=True):
    'Load a `Learner` object in `fname`, optionally putting it on the `cpu`'
    res = torch.load(fname, map_location=('cpu' if cpu else None))
    if hasattr(res, 'to_fp32'):
        res = res.to_fp32()
    if cpu:
        res.dls.cpu()
    return res
Load a `Learner` object in `fname`, optionally putting it on the `cpu`
def load_learner(fname, cpu=True):
    
    res = torch.load(fname, map_location=('cpu' if cpu else None))
    if hasattr(res, 'to_fp32'):
        res = res.to_fp32()
    if cpu:
        res.dls.cpu()
    return res