code: def save_model(self, net):
          
          if self.f_params is not None:
              f = self._format_target(net, self.f_params, -1)
              self._save_params(f, net, "f_params", "model parameters")
  
          if self.f_optimizer is not None:
              f = self._format_target(net, self.f_optimizer, -1)
              self._save_params(f, net, "f_optimizer", "optimizer state")
  
          if self.f_history is not None:
              f = self.f_history_
              self._save_params(f, net, "f_history", "history")
  
          if self.f_pickle:
              f_pickle = self._format_target(net, self.f_pickle, -1)
              with open_file_like(f_pickle, 'wb') as f:
                  pickle.dump(net, f)
docs: Save the model.
  
          This function saves some or all of the following:
  
            - model parameters;
            - optimizer state;
            - training history;
            - entire model object.