@patch
def export(self: Learner, fname='export.pkl'):
    'Export the content of `self` without the items and the optimizer state for inference'
    if rank_distrib():
        return
    old_dbunch = self.dls
    self.dls = self.dls.new_empty()
    state = self.opt.state_dict()
    self.opt = None
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        torch.save(self, (self.path / fname))
    self.create_opt()
    self.opt.load_state_dict(state)
    self.dls = old_dbunch
Export the content of `self` without the items and the optimizer state for inference
@patch
def export(self: Learner, fname='export.pkl'):
    
    if rank_distrib():
        return
    old_dbunch = self.dls
    self.dls = self.dls.new_empty()
    state = self.opt.state_dict()
    self.opt = None
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        torch.save(self, (self.path / fname))
    self.create_opt()
    self.opt.load_state_dict(state)
    self.dls = old_dbunch